src/Agent.php
protected function mergeRules(...$rulesGroups)
    {
        $merged = [];

        foreach ($rulesGroups as $rules) {
            foreach ($rules as $key => $value) {
                if (empty($merged[$key]))
                    $merged[$key] = $value;
                elseif (is_array($merged[$key]))
                    $merged[$key][] = $value;
                else
                    $merged[$key] .= '|' . $value;
            }
        }

        return $merged;
    }
protected function mergeRules(...$rulesGroups)
    {
        $merged = [];

        foreach ($rulesGroups as $rules) {
            foreach ($rules as $key => $value) {
                if (empty($merged[$key]))
                    $merged[$key] = $value;
                elseif (is_array($merged[$key]))
                    $merged[$key][] = $value;
                else
                    $merged[$key] .= '|' . $value;
            }
        }

        return $merged;
    }
protected function mergeRules ( ... $ rulesGroups ) { $ merged = [ ] ; foreach ( $ rulesGroups as $ rules ) { foreach ( $ rules as $ key => $ value ) { if ( empty ( $ merged [ $ key ] ) ) $ merged [ $ key ] = $ value ; elseif ( is_array ( $ merged [ $ key ] ) ) $ merged [ $ key ] [ ] = $ value ; else $ merged [ $ key ] .= '|' . $ value ; } } return $ merged ; }
Merge multiple rules into one array.

@param  array  $rulesGroups

@return array
Merge multiple rules into one array .