private function grabAttribsBeforeMethodToken(Tokens $tokens, $index)
    {
        static $tokenAttribsMap = [
            T_PRIVATE   => 'visibility',
            T_PROTECTED => 'visibility',
            T_PUBLIC    => null, // destroy T_PUBLIC token. This is literally the only change from the original
            T_ABSTRACT  => 'abstract',
            T_FINAL     => 'final',
            T_STATIC    => 'static',
        ];

        return $this->grabAttribsBeforeToken(
            $tokens,
            $index,
            $tokenAttribsMap,
            [
                'abstract'   => null,
                'final'      => null,
                'visibility' => null,
                'static'     => null,
            ]
        );
    }
private function grabAttribsBeforeMethodToken(Tokens $tokens, $index)
    {
        static $tokenAttribsMap = [
            T_PRIVATE   => 'visibility',
            T_PROTECTED => 'visibility',
            T_PUBLIC    => null, // destroy T_PUBLIC token. This is literally the only change from the original
            T_ABSTRACT  => 'abstract',
            T_FINAL     => 'final',
            T_STATIC    => 'static',
        ];

        return $this->grabAttribsBeforeToken(
            $tokens,
            $index,
            $tokenAttribsMap,
            [
                'abstract'   => null,
                'final'      => null,
                'visibility' => null,
                'static'     => null,
            ]
        );
    }
private function grabAttribsBeforeMethodToken ( Tokens $ tokens , $ index ) { static $ tokenAttribsMap = [ T_PRIVATE => 'visibility' , T_PROTECTED => 'visibility' , T_PUBLIC => null , // destroy T_PUBLIC token. This is literally the only change from the original T_ABSTRACT => 'abstract' , T_FINAL => 'final' , T_STATIC => 'static' , ] ; return $ this -> grabAttribsBeforeToken ( $ tokens , $ index , $ tokenAttribsMap , [ 'abstract' => null , 'final' => null , 'visibility' => null , 'static' => null , ] ) ; }
Grab attributes before method token at given index.

It's a shorthand for grabAttribsBeforeToken method.

@param Tokens $tokens Tokens collection
@param int    $index  token index

@return array array of grabbed attributes
Grab attributes before method token at given index .