/opt/cpanel/ea-wappspector/vendor/rector/rector/src/Util
Edit: /opt/cpanel/ea-wappspector/vendor/rector/rector/src/Util/ArrayParametersMerger.php (1624B)
mergeLeftToRightWithCallable($left, $right, function ($leftValue, $rightValue) {
return $this->merge($leftValue, $rightValue);
});
}
if ($left !== null) {
return $left;
}
if (!\is_array($right)) {
return $left;
}
return $right;
}
/**
* @param array
$left
* @param array $right
* @return mixed[]
*/
private function mergeLeftToRightWithCallable(array $left, array $right, callable $mergeCallback) : array
{
foreach ($left as $key => $val) {
if (\is_int($key)) {
// prevent duplicated values in unindexed arrays
if (!\in_array($val, $right, \true)) {
$right[] = $val;
}
} else {
if (isset($right[$key])) {
$val = $mergeCallback($val, $right[$key]);
}
$right[$key] = $val;
}
}
return $right;
}
}