src/Standards/BestIt/Sniffs/Formatting/AlphabeticClassContentSniff.php
private function getContentsOfTokenType(int $token): array
    {
        $helper = new PropertyHelper($this->file);
        $tokenPoss = TokenHelper::findNextAll(
            $this->file->getBaseFile(),
            [$token],
            $this->stackPos + 1,
            $this->token['scope_closer']
        );

        $foundContentsOrg = [];

        foreach ($tokenPoss as $tokenPos) {
            $tokenContentPos = $tokenPos;

            if (($token === T_VARIABLE) && (!$helper->isProperty($tokenPos))) {
                continue;
            }

            if ($token !== T_VARIABLE) {
                $tokenContentPos = $this->file->findNext([T_STRING], $tokenPos);
            }

            $foundContentsOrg[$tokenContentPos] = $this->tokens[$tokenContentPos]['content'];
        }

        return $foundContentsOrg;
    }
private function getContentsOfTokenType(int $token): array
    {
        $helper = new PropertyHelper($this->file);
        $tokenPoss = TokenHelper::findNextAll(
            $this->file->getBaseFile(),
            [$token],
            $this->stackPos + 1,
            $this->token['scope_closer']
        );

        $foundContentsOrg = [];

        foreach ($tokenPoss as $tokenPos) {
            $tokenContentPos = $tokenPos;

            if (($token === T_VARIABLE) && (!$helper->isProperty($tokenPos))) {
                continue;
            }

            if ($token !== T_VARIABLE) {
                $tokenContentPos = $this->file->findNext([T_STRING], $tokenPos);
            }

            $foundContentsOrg[$tokenContentPos] = $this->tokens[$tokenContentPos]['content'];
        }

        return $foundContentsOrg;
    }
private function getContentsOfTokenType ( int $ token ) : array { $ helper = new PropertyHelper ( $ this -> file ) ; $ tokenPoss = TokenHelper :: findNextAll ( $ this -> file -> getBaseFile ( ) , [ $ token ] , $ this -> stackPos + 1 , $ this -> token [ 'scope_closer' ] ) ; $ foundContentsOrg = [ ] ; foreach ( $ tokenPoss as $ tokenPos ) { $ tokenContentPos = $ tokenPos ; if ( ( $ token === T_VARIABLE ) && ( ! $ helper -> isProperty ( $ tokenPos ) ) ) { continue ; } if ( $ token !== T_VARIABLE ) { $ tokenContentPos = $ this -> file -> findNext ( [ T_STRING ] , $ tokenPos ) ; } $ foundContentsOrg [ $ tokenContentPos ] = $ this -> tokens [ $ tokenContentPos ] [ 'content' ] ; } return $ foundContentsOrg ; }
Returns the contents of the token type.

@param int $token The contents with their position as array key.

@return array
Returns the contents of the token type .