public function getFQExtendedClassName(File $phpcsFile, $stackPtr)
    {
        $tokens = $phpcsFile->getTokens();

        // Check for the existence of the token.
        if (isset($tokens[$stackPtr]) === false) {
            return '';
        }

        if ($tokens[$stackPtr]['code'] !== \T_CLASS
            && $tokens[$stackPtr]['type'] !== 'T_ANON_CLASS'
            && $tokens[$stackPtr]['type'] !== 'T_INTERFACE'
        ) {
            return '';
        }

        $extends = PHPCSHelper::findExtendedClassName($phpcsFile, $stackPtr);
        if (empty($extends) || \is_string($extends) === false) {
            return '';
        }

        return $this->getFQName($phpcsFile, $stackPtr, $extends);
    }
public function getFQExtendedClassName(File $phpcsFile, $stackPtr)
    {
        $tokens = $phpcsFile->getTokens();

        // Check for the existence of the token.
        if (isset($tokens[$stackPtr]) === false) {
            return '';
        }

        if ($tokens[$stackPtr]['code'] !== \T_CLASS
            && $tokens[$stackPtr]['type'] !== 'T_ANON_CLASS'
            && $tokens[$stackPtr]['type'] !== 'T_INTERFACE'
        ) {
            return '';
        }

        $extends = PHPCSHelper::findExtendedClassName($phpcsFile, $stackPtr);
        if (empty($extends) || \is_string($extends) === false) {
            return '';
        }

        return $this->getFQName($phpcsFile, $stackPtr, $extends);
    }
public function getFQExtendedClassName ( File $ phpcsFile , $ stackPtr ) { $ tokens = $ phpcsFile -> getTokens ( ) ; // Check for the existence of the token. if ( isset ( $ tokens [ $ stackPtr ] ) === false ) { return '' ; } if ( $ tokens [ $ stackPtr ] [ 'code' ] !== \ T_CLASS && $ tokens [ $ stackPtr ] [ 'type' ] !== 'T_ANON_CLASS' && $ tokens [ $ stackPtr ] [ 'type' ] !== 'T_INTERFACE' ) { return '' ; } $ extends = PHPCSHelper :: findExtendedClassName ( $ phpcsFile , $ stackPtr ) ; if ( empty ( $ extends ) || \ is_string ( $ extends ) === false ) { return '' ; } return $ this -> getFQName ( $ phpcsFile , $ stackPtr , $ extends ) ; }
Returns the fully qualified name of the class that the specified class extends.

Returns an empty string if the class does not extend another class or if
the class name could not be reliably inferred.

@param \PHP_CodeSniffer_File $phpcsFile The file being scanned.
@param int                   $stackPtr  The position of a T_CLASS token.

@return string
Returns the fully qualified name of the class that the specified class extends .