Task/ArrayMergeTask.php
public function execute(ProcessState $state)
    {
        $input = $state->getInput();
        if (!\is_array($input)) {
            throw new \UnexpectedValueException('Input must be an array');
        }

        $mergeFunction = $this->getOption($state, 'merge_function');
        if ($mergeFunction == 'array_merge') {
            $this->mergedOutput = \array_merge($this->mergedOutput, $input);
        } elseif ($mergeFunction == 'array_merge_recursive') {
            $this->mergedOutput = \array_merge_recursive($this->mergedOutput, $input);
        } elseif ($mergeFunction == 'array_replace') {
            $this->mergedOutput = \array_replace($this->mergedOutput, $input);
        } elseif ($mergeFunction == 'array_replace_recursive') {
            $this->mergedOutput = \array_replace_recursive($this->mergedOutput, $input);
        } else {
            throw new \InvalidArgumentException("Unknown merge function {$mergeFunction}");
        }
    }
public function execute(ProcessState $state)
    {
        $input = $state->getInput();
        if (!\is_array($input)) {
            throw new \UnexpectedValueException('Input must be an array');
        }

        $mergeFunction = $this->getOption($state, 'merge_function');
        if ($mergeFunction == 'array_merge') {
            $this->mergedOutput = \array_merge($this->mergedOutput, $input);
        } elseif ($mergeFunction == 'array_merge_recursive') {
            $this->mergedOutput = \array_merge_recursive($this->mergedOutput, $input);
        } elseif ($mergeFunction == 'array_replace') {
            $this->mergedOutput = \array_replace($this->mergedOutput, $input);
        } elseif ($mergeFunction == 'array_replace_recursive') {
            $this->mergedOutput = \array_replace_recursive($this->mergedOutput, $input);
        } else {
            throw new \InvalidArgumentException("Unknown merge function {$mergeFunction}");
        }
    }
@param ProcessState $state

@throws \UnexpectedValueException