@@ -46,14 +46,15 @@ public function __construct(mixed $value)
4646 *
4747 * @throws ExpectationFailedException
4848 */
49- public function evaluate (mixed $ other , string $ description = '' , bool $ returnResult = false ): ? bool
49+ public function evaluate (mixed $ other , string $ description = '' , bool $ returnResult = false ): bool
5050 {
5151 assert (is_array ($ this ->value ));
5252 assert (is_array ($ other ));
5353
5454 // cribbed from `src/Framework/Constraint/Equality/IsEqualCanonicalizing.php`
5555 try {
5656 $ this ->compareDictionary ($ this ->value , $ other );
57+
5758 } catch (ComparisonFailure $ f ) {
5859 if ($ returnResult ) {
5960 return false ;
@@ -64,7 +65,6 @@ public function evaluate(mixed $other, string $description = '', bool $returnRes
6465 $ f ,
6566 );
6667 }
67-
6868 return true ;
6969 }
7070
@@ -80,6 +80,7 @@ public function toString(): string
8080 * cribbed from `vendor/sebastian/comparator/src/ArrayComparator.php`
8181 * This potentially should be a dictionarycomparator or type-strict arraycomparator.
8282 */
83+ /** @phpstan-ignore missingType.iterableValue, missingType.iterableValue, missingType.iterableValue */
8384 private function compareDictionary (array $ expected , array $ actual , array &$ processed = []): void
8485 {
8586 $ remaining = $ actual ;
@@ -204,6 +205,7 @@ private function compareDictionary(array $expected, array $actual, array &$proce
204205 * cribbed from `vendor/sebastian/comparator/src/ObjectComparator.php`
205206 * this potentially should be a type-strict objectcomparator.
206207 */
208+ /** @phpstan-ignore missingType.iterableValue */
207209 private function compareObjects (object $ expected , object $ actual , array &$ processed = []): void
208210 {
209211 if ($ actual ::class !== $ expected ::class) {
@@ -251,6 +253,7 @@ private function compareObjects(object $expected, object $actual, array &$proces
251253 /**
252254 * cribbed from `vendor/sebastian/comparator/src/ObjectComparator.php`.
253255 */
256+ /** @phpstan-ignore missingType.iterableValue */
254257 private function toArray (object $ object ): array
255258 {
256259 return (new Exporter )->toArray ($ object );
0 commit comments