@@ -63,7 +63,6 @@ public function evaluate($other, $description = '', $returnResult = false)
63
63
$ this ->subset = $ this ->toArray ($ this ->subset );
64
64
65
65
$ intersect = $ this ->arrayIntersectRecursive ($ other , $ this ->subset );
66
-
67
66
$ this ->deepSort ($ intersect );
68
67
$ this ->deepSort ($ this ->subset );
69
68
@@ -130,13 +129,9 @@ private function toArray(iterable $other): array
130
129
131
130
private function isAssociative (array $ array ): bool
132
131
{
133
- return \array_reduce (
134
- \array_keys ($ array ),
135
- function (bool $ carry , $ key ): bool {
136
- return $ carry || \is_string ($ key );
137
- },
138
- false
139
- );
132
+ return \array_reduce (\array_keys ($ array ), function (bool $ carry , $ key ): bool {
133
+ return $ carry || \is_string ($ key );
134
+ }, false );
140
135
}
141
136
142
137
private function compare ($ first , $ second ): bool
@@ -152,8 +147,6 @@ private function deepSort(array &$array): void
152
147
}
153
148
}
154
149
155
- unset($ value );
156
-
157
150
if ($ this ->isAssociative ($ array )) {
158
151
\ksort ($ array );
159
152
} else {
@@ -197,7 +190,10 @@ private function arrayIntersectRecursive(array $array, array $subset): array
197
190
}
198
191
} else {
199
192
foreach ($ subset as $ key => $ subset_value ) {
200
- if (!\is_array ($ subset_value ) && $ this ->compare ($ subset_value , $ array_value )) {
193
+ if (!\is_array ($ subset_value ) && $ this ->compare (
194
+ $ subset_value ,
195
+ $ array_value
196
+ )) {
201
197
$ intersect [$ key ] = $ array_value ;
202
198
203
199
break ;
0 commit comments