@@ -46,14 +46,15 @@ public function __construct(mixed $value)
46
46
*
47
47
* @throws ExpectationFailedException
48
48
*/
49
- public function evaluate (mixed $ other , string $ description = '' , bool $ returnResult = false ): ? bool
49
+ public function evaluate (mixed $ other , string $ description = '' , bool $ returnResult = false ): bool
50
50
{
51
51
assert (is_array ($ this ->value ));
52
52
assert (is_array ($ other ));
53
53
54
54
// cribbed from `src/Framework/Constraint/Equality/IsEqualCanonicalizing.php`
55
55
try {
56
56
$ this ->compareDictionary ($ this ->value , $ other );
57
+
57
58
} catch (ComparisonFailure $ f ) {
58
59
if ($ returnResult ) {
59
60
return false ;
@@ -64,7 +65,6 @@ public function evaluate(mixed $other, string $description = '', bool $returnRes
64
65
$ f ,
65
66
);
66
67
}
67
-
68
68
return true ;
69
69
}
70
70
@@ -80,6 +80,7 @@ public function toString(): string
80
80
* cribbed from `vendor/sebastian/comparator/src/ArrayComparator.php`
81
81
* This potentially should be a dictionarycomparator or type-strict arraycomparator.
82
82
*/
83
+ /** @phpstan-ignore missingType.iterableValue, missingType.iterableValue, missingType.iterableValue */
83
84
private function compareDictionary (array $ expected , array $ actual , array &$ processed = []): void
84
85
{
85
86
$ remaining = $ actual ;
@@ -204,6 +205,7 @@ private function compareDictionary(array $expected, array $actual, array &$proce
204
205
* cribbed from `vendor/sebastian/comparator/src/ObjectComparator.php`
205
206
* this potentially should be a type-strict objectcomparator.
206
207
*/
208
+ /** @phpstan-ignore missingType.iterableValue */
207
209
private function compareObjects (object $ expected , object $ actual , array &$ processed = []): void
208
210
{
209
211
if ($ actual ::class !== $ expected ::class) {
@@ -251,6 +253,7 @@ private function compareObjects(object $expected, object $actual, array &$proces
251
253
/**
252
254
* cribbed from `vendor/sebastian/comparator/src/ObjectComparator.php`.
253
255
*/
256
+ /** @phpstan-ignore missingType.iterableValue */
254
257
private function toArray (object $ object ): array
255
258
{
256
259
return (new Exporter )->toArray ($ object );
0 commit comments