PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::grabAttribsBeforeToken PHP Метод

grabAttribsBeforeToken() приватный Метод

Grab info about attributes before token at given index.
private grabAttribsBeforeToken ( Tokens $tokens, integer $index, array $tokenAttribsMap, array $attribs ) : array
$tokens PhpCsFixer\Tokenizer\Tokens Tokens collection
$index integer token index
$tokenAttribsMap array token to attribute name map
$attribs array array of token attributes
Результат array map of grabbed attributes, key is attribute name and value is array of index and clone of Token
    private function grabAttribsBeforeToken(Tokens $tokens, $index, array $tokenAttribsMap, array $attribs)
    {
        while (true) {
            $token = $tokens[--$index];
            if (!$token->isArray()) {
                if ($token->equalsAny(array('{', '}', '(', ')'))) {
                    break;
                }
                continue;
            }
            // if token is attribute, set token attribute name
            if (isset($tokenAttribsMap[$token->getId()])) {
                $attribs[$tokenAttribsMap[$token->getId()]] = array('token' => clone $token, 'index' => $index);
                continue;
            }
            if ($token->isGivenKind(array(T_WHITESPACE, T_COMMENT, T_DOC_COMMENT))) {
                continue;
            }
            break;
        }
        return $attribs;
    }