Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
zendframework/zendframework#6899 - avoiding unused variable assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius committed Dec 6, 2014
1 parent 0cf2e1f commit 050e947
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/ArrayUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,8 @@ public static function iteratorToArray($iterator, $recursive = true)
public static function merge(array $a, array $b, $preserveNumericKeys = false)
{
foreach ($b as $key => $value) {
$isRemove = $value instanceof MergeRemoveKey;

if (isset($a[$key]) || array_key_exists($key, $a)) {
if ($isRemove) {
if ($value instanceof MergeRemoveKey) {
unset($a[$key]);
} elseif (!$preserveNumericKeys && is_int($key)) {
$a[] = $value;
Expand All @@ -271,7 +269,7 @@ public static function merge(array $a, array $b, $preserveNumericKeys = false)
$a[$key] = $value;
}
} else {
if (!$isRemove) {
if (!$value instanceof MergeRemoveKey) {
$a[$key] = $value;
}
}
Expand Down

0 comments on commit 050e947

Please sign in to comment.