Supported Versions: PHP 5 >= 5.3.0, PHP 7, PHP 8
Replaces elements from passed arrays into the first array recursively
<?php array_replace_recursive(array $array, array ...$replacements): array
<?php public function replaceRecursive($items)
{
return new static(array_replace_recursive($this->items, $this->getArrayableItems($items)));
}
<?php public static function resolveRelationUsing($name, Closure $callback)
{
static::$relationResolvers = array_replace_recursive(
static::$relationResolvers,
[static::class => [$name => $callback]]
);
}
<?php public function withOptions(array $options)
{
return tap($this, function () use ($options) {
$this->options = array_replace_recursive(
array_merge_recursive($this->options, Arr::only($options, $this->mergeableOptions)),
$options
);
});
}
<?php public function mergeOptions(...$options)
{
return array_replace_recursive(
array_merge_recursive($this->options, Arr::only($options, $this->mergeableOptions)),
...$options
);
}
<?php public function all($keys = null)
{
$input = array_replace_recursive($this->input(), $this->allFiles());
if (! $keys) {
return $input;
<?php $other = $this->toArray($other);
$this->subset = $this->toArray($this->subset);
$patched = array_replace_recursive($other, $this->subset);
if ($this->strict) {
$result = $other === $patched;
<?php $file = "{$path}/vendor/{$namespace}/{$locale}/{$group}.php";
if ($this->files->exists($file)) {
$lines = array_replace_recursive($lines, $this->files->getRequire($file));
}
return $lines;
<?php return collect($paths)
->reduce(function ($output, $path) use ($locale, $group) {
if ($this->files->exists($full = "{$path}/{$locale}/{$group}.php")) {
$output = array_replace_recursive($output, $this->files->getRequire($full));
}
return $output;
<?php public function newInstance(array $config = [])
{
$parser = new self(array_replace_recursive($this->config(), $config));
foreach ($this->extensions as $ext) {
$parser->addExtensions($ext);
<?php if ($config->get('capath')) {
$httpDownloaderOptions['ssl']['capath'] = $config->get('capath');
}
$httpDownloaderOptions = array_replace_recursive($httpDownloaderOptions, $options);
}
try {
$httpDownloader = new HttpDownloader($io, $config, $httpDownloaderOptions, $disableTls);
<?php }
$this->options = array_replace_recursive($this->options, $options);
$this->config = $config;
if (self::isCurlEnabled()) {
<?php public function setOptions(array $options)
{
$this->options = array_replace_recursive($this->options, $options);
}
<?php private function addJob($request, $sync = false)
{
$request['options'] = array_replace_recursive($this->options, $request['options']);
$job = array(
<?php }
$this->options = array_replace_recursive($this->options, $options);
$this->config = $config;
$this->authHelper = isset($authHelper) ? $authHelper : new AuthHelper($io, $config);
$this->proxyManager = ProxyManager::getInstance();
<?php public function setOptions(array $options)
{
$this->options = array_replace_recursive($this->options, $options);
}