private function processSingularToken(File $phpcsFile, $stackPtr)
    {
        $tokens      = $phpcsFile->getTokens();
        $FQClassName = '';

        if ($tokens[$stackPtr]['type'] === 'T_NEW') {
            $FQClassName = $this->getFQClassNameFromNewToken($phpcsFile, $stackPtr);

        } elseif ($tokens[$stackPtr]['type'] === 'T_CLASS' || $tokens[$stackPtr]['type'] === 'T_ANON_CLASS') {
            $FQClassName = $this->getFQExtendedClassName($phpcsFile, $stackPtr);

        } elseif ($tokens[$stackPtr]['type'] === 'T_DOUBLE_COLON') {
            $FQClassName = $this->getFQClassNameFromDoubleColonToken($phpcsFile, $stackPtr);
        }

        if ($FQClassName === '') {
            return;
        }

        $className   = substr($FQClassName, 1); // Remove global namespace indicator.
        $classNameLc = strtolower($className);

        if (isset($this->newClasses[$classNameLc]) === false) {
            return;
        }

        $itemInfo = array(
            'name'   => $className,
            'nameLc' => $classNameLc,
        );
        $this->handleFeature($phpcsFile, $stackPtr, $itemInfo);
    }
private function processSingularToken(File $phpcsFile, $stackPtr)
    {
        $tokens      = $phpcsFile->getTokens();
        $FQClassName = '';

        if ($tokens[$stackPtr]['type'] === 'T_NEW') {
            $FQClassName = $this->getFQClassNameFromNewToken($phpcsFile, $stackPtr);

        } elseif ($tokens[$stackPtr]['type'] === 'T_CLASS' || $tokens[$stackPtr]['type'] === 'T_ANON_CLASS') {
            $FQClassName = $this->getFQExtendedClassName($phpcsFile, $stackPtr);

        } elseif ($tokens[$stackPtr]['type'] === 'T_DOUBLE_COLON') {
            $FQClassName = $this->getFQClassNameFromDoubleColonToken($phpcsFile, $stackPtr);
        }

        if ($FQClassName === '') {
            return;
        }

        $className   = substr($FQClassName, 1); // Remove global namespace indicator.
        $classNameLc = strtolower($className);

        if (isset($this->newClasses[$classNameLc]) === false) {
            return;
        }

        $itemInfo = array(
            'name'   => $className,
            'nameLc' => $classNameLc,
        );
        $this->handleFeature($phpcsFile, $stackPtr, $itemInfo);
    }
private function processSingularToken ( File $ phpcsFile , $ stackPtr ) { $ tokens = $ phpcsFile -> getTokens ( ) ; $ FQClassName = '' ; if ( $ tokens [ $ stackPtr ] [ 'type' ] === 'T_NEW' ) { $ FQClassName = $ this -> getFQClassNameFromNewToken ( $ phpcsFile , $ stackPtr ) ; } elseif ( $ tokens [ $ stackPtr ] [ 'type' ] === 'T_CLASS' || $ tokens [ $ stackPtr ] [ 'type' ] === 'T_ANON_CLASS' ) { $ FQClassName = $ this -> getFQExtendedClassName ( $ phpcsFile , $ stackPtr ) ; } elseif ( $ tokens [ $ stackPtr ] [ 'type' ] === 'T_DOUBLE_COLON' ) { $ FQClassName = $ this -> getFQClassNameFromDoubleColonToken ( $ phpcsFile , $ stackPtr ) ; } if ( $ FQClassName === '' ) { return ; } $ className = substr ( $ FQClassName , 1 ) ; // Remove global namespace indicator. $ classNameLc = strtolower ( $ className ) ; if ( isset ( $ this -> newClasses [ $ classNameLc ] ) === false ) { return ; } $ itemInfo = array ( 'name' => $ className , 'nameLc' => $ classNameLc , ) ; $ this -> handleFeature ( $ phpcsFile , $ stackPtr , $ itemInfo ) ; }
Processes this test for when a token resulting in a singular class name is encountered.

@param \PHP_CodeSniffer_File $phpcsFile The file being scanned.
@param int                   $stackPtr  The position of the current token in
the stack passed in $tokens.

@return void
Processes this test for when a token resulting in a singular class name is encountered .