vendor/squizlabs/php_codesniffer/src/Files/File.php
/**
     * Returns the names of the interfaces that the specified class implements.
     *
     * Returns FALSE on error or if there are no implemented interface names.
     *
     * @param int $stackPtr The stack position of the class.
     *
     * @return array|false
     */
Returns the names of the interfaces that the specified class implements.
Returns FALSE on error or if there are no implemented interface names.

@param int $stackPtr The stack position of the class.

@return array|false
Returns the names of the interfaces that the specified class implements . Returns FALSE on error or if there are no implemented interface names . @param int $stackPtr The stack position of the class . @return array|false
public function findImplementedInterfaceNames($stackPtr)
    {
        if (isset($this->tokens[$stackPtr]) === false) {
            return false;
        }
        if ($this->tokens[$stackPtr]['code'] !== T_CLASS
            && $this->tokens[$stackPtr]['code'] !== T_ANON_CLASS
        ) {
            return false;
        }
        if (isset($this->tokens[$stackPtr]['scope_closer']) === false) {
            return false;
        }
        $classOpenerIndex = $this->tokens[$stackPtr]['scope_opener'];
        $implementsIndex  = $this->findNext(T_IMPLEMENTS, $stackPtr, $classOpenerIndex);
        if ($implementsIndex === false) {
            return false;
        }
        $find = [
            T_NS_SEPARATOR,
            T_STRING,
            T_WHITESPACE,
            T_COMMA,
        ];
        $end  = $this->findNext($find, ($implementsIndex + 1), ($classOpenerIndex + 1), true);
        $name = $this->getTokensAsString(($implementsIndex + 1), ($end - $implementsIndex - 1));
        $name = trim($name);
        if ($name === '') {
            return false;
        } else {
            $names = explode(',', $name);
            $names = array_map('trim', $names);
            return $names;
        }
    }
public function findImplementedInterfaceNames ( $ stackPtr ) { if ( isset ( $ this -> tokens [ $ stackPtr ] ) === false ) { return false ; } if ( $ this -> tokens [ $ stackPtr ] [ 'code' ] !== T_CLASS && $ this -> tokens [ $ stackPtr ] [ 'code' ] !== T_ANON_CLASS ) { return false ; } if ( isset ( $ this -> tokens [ $ stackPtr ] [ 'scope_closer' ] ) === false ) { return false ; } $ classOpenerIndex = $ this -> tokens [ $ stackPtr ] [ 'scope_opener' ] ; $ implementsIndex = $ this -> findNext ( T_IMPLEMENTS , $ stackPtr , $ classOpenerIndex ) ; if ( $ implementsIndex === false ) { return false ; } $ find = [ T_NS_SEPARATOR , T_STRING , T_WHITESPACE , T_COMMA , ] ; $ end = $ this -> findNext ( $ find , ( $ implementsIndex + 1 ) , ( $ classOpenerIndex + 1 ) , true ) ; $ name = $ this -> getTokensAsString ( ( $ implementsIndex + 1 ) , ( $ end - $ implementsIndex - 1 ) ) ; $ name = trim ( $ name ) ; if ( $ name === '' ) { return false ; } else { $ names = explode ( ',' , $ name ) ; $ names = array_map ( 'trim' , $ names ) ; return $ names ; } }
Returns the names of the interfaces that the specified class implements.
Returns the names of the interfaces that the specified class implements .
// Check for the existence of the token.