src/Loader.php
protected function _simplify(Rule $rule, string $key): array
    {
        if ($rule instanceof PatternRule) {
            return [$key => $rule];
        }

        /**
         * @var PrefixRule $rule
         */
        $rules = [];
        foreach ($rule->resolver() as $index => $item) {
            $location = $key . '.' . $index;
            $rules[] = $this->_simplify($item, $location);
        }

        return \array_merge(...$rules);
    }
protected function _simplify(Rule $rule, string $key): array
    {
        if ($rule instanceof PatternRule) {
            return [$key => $rule];
        }

        /**
         * @var PrefixRule $rule
         */
        $rules = [];
        foreach ($rule->resolver() as $index => $item) {
            $location = $key . '.' . $index;
            $rules[] = $this->_simplify($item, $location);
        }

        return \array_merge(...$rules);
    }
protected function _simplify ( Rule $ rule , string $ key ) : array { if ( $ rule instanceof PatternRule ) { return [ $ key => $ rule ] ; } /**
         * @var PrefixRule $rule
         */ $ rules = [ ] ; foreach ( $ rule -> resolver ( ) as $ index => $ item ) { $ location = $ key . '.' . $ index ; $ rules [ ] = $ this -> _simplify ( $ item , $ location ) ; } return \ array_merge ( ... $ rules ) ; }
@param Rule $rule
@param string $key

@return PatternRule[]
@param Rule $rule @param string $key