Skip to content

Commit 0fb435b

Browse files
Revert "Fix CS/WS issues"
This reverts commit f3b1df0.
1 parent 2192bf8 commit 0fb435b

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/Framework/Constraint/ArraySubset.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public function evaluate($other, $description = '', $returnResult = false)
6363
$this->subset = $this->toArray($this->subset);
6464

6565
$intersect = $this->arrayIntersectRecursive($other, $this->subset);
66-
6766
$this->deepSort($intersect);
6867
$this->deepSort($this->subset);
6968

@@ -130,13 +129,9 @@ private function toArray(iterable $other): array
130129

131130
private function isAssociative(array $array): bool
132131
{
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);
140135
}
141136

142137
private function compare($first, $second): bool
@@ -152,8 +147,6 @@ private function deepSort(array &$array): void
152147
}
153148
}
154149

155-
unset($value);
156-
157150
if ($this->isAssociative($array)) {
158151
\ksort($array);
159152
} else {
@@ -197,7 +190,10 @@ private function arrayIntersectRecursive(array $array, array $subset): array
197190
}
198191
} else {
199192
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+
)) {
201197
$intersect[$key] = $array_value;
202198

203199
break;

0 commit comments

Comments
 (0)