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;
    }