Skip to content

Commit

Permalink
Revert "Fix CS/WS issues"
Browse files Browse the repository at this point in the history
This reverts commit f3b1df0.
  • Loading branch information
sebastianbergmann committed Aug 7, 2018
1 parent 2192bf8 commit 0fb435b
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/Framework/Constraint/ArraySubset.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public function evaluate($other, $description = '', $returnResult = false)
$this->subset = $this->toArray($this->subset);

$intersect = $this->arrayIntersectRecursive($other, $this->subset);

$this->deepSort($intersect);
$this->deepSort($this->subset);

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

private function isAssociative(array $array): bool
{
return \array_reduce(
\array_keys($array),
function (bool $carry, $key): bool {
return $carry || \is_string($key);
},
false
);
return \array_reduce(\array_keys($array), function (bool $carry, $key): bool {
return $carry || \is_string($key);
}, false);
}

private function compare($first, $second): bool
Expand All @@ -152,8 +147,6 @@ private function deepSort(array &$array): void
}
}

unset($value);

if ($this->isAssociative($array)) {
\ksort($array);
} else {
Expand Down Expand Up @@ -197,7 +190,10 @@ private function arrayIntersectRecursive(array $array, array $subset): array
}
} else {
foreach ($subset as $key => $subset_value) {
if (!\is_array($subset_value) && $this->compare($subset_value, $array_value)) {
if (!\is_array($subset_value) && $this->compare(
$subset_value,
$array_value
)) {
$intersect[$key] = $array_value;

break;
Expand Down

0 comments on commit 0fb435b

Please sign in to comment.