original_string: private function getRules(string $action): array
      {
          $rules = [];
          $parts = explode(self::DELIMITER, $action);
  
          while (array_pop($parts)) {
              $rules[] = implode(self::DELIMITER, $parts) . self::DELIMITER . self::WILDCARD;
          }
  
          $rules = array_reverse($rules);
          $rules[0] = trim($rules[0], self::DELIMITER);
          $rules[] = $action;
  
          return $rules;
      }
code: private function getRules(string $action): array
      {
          $rules = [];
          $parts = explode(self::DELIMITER, $action);
  
          while (array_pop($parts)) {
              $rules[] = implode(self::DELIMITER, $parts) . self::DELIMITER . self::WILDCARD;
          }
  
          $rules = array_reverse($rules);
          $rules[0] = trim($rules[0], self::DELIMITER);
          $rules[] = $action;
  
          return $rules;
      }
code_tokens: private function getRules ( string $ action ) : array { $ rules = [ ] ; $ parts = explode ( self :: DELIMITER , $ action ) ; while ( array_pop ( $ parts ) ) { $ rules [ ] = implode ( self :: DELIMITER , $ parts ) . self :: DELIMITER . self :: WILDCARD ; } $ rules = array_reverse ( $ rules ) ; $ rules [ 0 ] = trim ( $ rules [ 0 ] , self :: DELIMITER ) ; $ rules [ ] = $ action ; return $ rules ; }
docstring: Converts an action with potentially colon delimiters
  into a set of permissions to check for.
  
  @example
  An action of "acme:blog:command:publish-article" becomes
  an array of:
  [
  '*',
  'acme:*',
  'acme:blog:*',
  'acme:blog:command:*',
  'acme:blog:command:publish-article',
  ]
  
  @param string $action
  
  @return string[]
docstring_tokens: Converts an action with potentially colon delimiters into a set of permissions to check for .