code: 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);
      }
docs: @param Rule $rule
  @param string $key
  
  @return PatternRule[]