public function is_targetted_token( $stackPtr ) {

		$token     = $this->tokens[ $stackPtr ];
		$classname = '';

		if ( \in_array( $token['code'], array( \T_NEW, \T_EXTENDS, \T_IMPLEMENTS ), true ) ) {
			if ( \T_NEW === $token['code'] ) {
				$nameEnd = ( $this->phpcsFile->findNext( array( \T_OPEN_PARENTHESIS, \T_WHITESPACE, \T_SEMICOLON, \T_OBJECT_OPERATOR ), ( $stackPtr + 2 ) ) - 1 );
			} else {
				$nameEnd = ( $this->phpcsFile->findNext( array( \T_CLOSE_CURLY_BRACKET, \T_WHITESPACE ), ( $stackPtr + 2 ) ) - 1 );
			}

			$length    = ( $nameEnd - ( $stackPtr + 1 ) );
			$classname = $this->phpcsFile->getTokensAsString( ( $stackPtr + 2 ), $length );

			if ( \T_NS_SEPARATOR !== $this->tokens[ ( $stackPtr + 2 ) ]['code'] ) {
				$classname = $this->get_namespaced_classname( $classname, ( $stackPtr - 1 ) );
			}
		}

		if ( \T_DOUBLE_COLON === $token['code'] ) {
			$nameEnd   = $this->phpcsFile->findPrevious( \T_STRING, ( $stackPtr - 1 ) );
			$nameStart = ( $this->phpcsFile->findPrevious( array( \T_STRING, \T_NS_SEPARATOR, \T_NAMESPACE ), ( $nameEnd - 1 ), null, true, null, true ) + 1 );
			$length    = ( $nameEnd - ( $nameStart - 1 ) );
			$classname = $this->phpcsFile->getTokensAsString( $nameStart, $length );

			if ( \T_NS_SEPARATOR !== $this->tokens[ $nameStart ]['code'] ) {
				$classname = $this->get_namespaced_classname( $classname, ( $nameStart - 1 ) );
			}
		}

		// Stop if we couldn't determine a classname.
		if ( empty( $classname ) ) {
			return false;
		}

		// Nothing to do if 'parent', 'self' or 'static'.
		if ( \in_array( $classname, array( 'parent', 'self', 'static' ), true ) ) {
			return false;
		}

		$this->classname = $classname;
		return true;
	}
public function is_targetted_token( $stackPtr ) {

		$token     = $this->tokens[ $stackPtr ];
		$classname = '';

		if ( \in_array( $token['code'], array( \T_NEW, \T_EXTENDS, \T_IMPLEMENTS ), true ) ) {
			if ( \T_NEW === $token['code'] ) {
				$nameEnd = ( $this->phpcsFile->findNext( array( \T_OPEN_PARENTHESIS, \T_WHITESPACE, \T_SEMICOLON, \T_OBJECT_OPERATOR ), ( $stackPtr + 2 ) ) - 1 );
			} else {
				$nameEnd = ( $this->phpcsFile->findNext( array( \T_CLOSE_CURLY_BRACKET, \T_WHITESPACE ), ( $stackPtr + 2 ) ) - 1 );
			}

			$length    = ( $nameEnd - ( $stackPtr + 1 ) );
			$classname = $this->phpcsFile->getTokensAsString( ( $stackPtr + 2 ), $length );

			if ( \T_NS_SEPARATOR !== $this->tokens[ ( $stackPtr + 2 ) ]['code'] ) {
				$classname = $this->get_namespaced_classname( $classname, ( $stackPtr - 1 ) );
			}
		}

		if ( \T_DOUBLE_COLON === $token['code'] ) {
			$nameEnd   = $this->phpcsFile->findPrevious( \T_STRING, ( $stackPtr - 1 ) );
			$nameStart = ( $this->phpcsFile->findPrevious( array( \T_STRING, \T_NS_SEPARATOR, \T_NAMESPACE ), ( $nameEnd - 1 ), null, true, null, true ) + 1 );
			$length    = ( $nameEnd - ( $nameStart - 1 ) );
			$classname = $this->phpcsFile->getTokensAsString( $nameStart, $length );

			if ( \T_NS_SEPARATOR !== $this->tokens[ $nameStart ]['code'] ) {
				$classname = $this->get_namespaced_classname( $classname, ( $nameStart - 1 ) );
			}
		}

		// Stop if we couldn't determine a classname.
		if ( empty( $classname ) ) {
			return false;
		}

		// Nothing to do if 'parent', 'self' or 'static'.
		if ( \in_array( $classname, array( 'parent', 'self', 'static' ), true ) ) {
			return false;
		}

		$this->classname = $classname;
		return true;
	}
public function is_targetted_token ( $ stackPtr ) { $ token = $ this -> tokens [ $ stackPtr ] ; $ classname = '' ; if ( \ in_array ( $ token [ 'code' ] , array ( \ T_NEW , \ T_EXTENDS , \ T_IMPLEMENTS ) , true ) ) { if ( \ T_NEW === $ token [ 'code' ] ) { $ nameEnd = ( $ this -> phpcsFile -> findNext ( array ( \ T_OPEN_PARENTHESIS , \ T_WHITESPACE , \ T_SEMICOLON , \ T_OBJECT_OPERATOR ) , ( $ stackPtr + 2 ) ) - 1 ) ; } else { $ nameEnd = ( $ this -> phpcsFile -> findNext ( array ( \ T_CLOSE_CURLY_BRACKET , \ T_WHITESPACE ) , ( $ stackPtr + 2 ) ) - 1 ) ; } $ length = ( $ nameEnd - ( $ stackPtr + 1 ) ) ; $ classname = $ this -> phpcsFile -> getTokensAsString ( ( $ stackPtr + 2 ) , $ length ) ; if ( \ T_NS_SEPARATOR !== $ this -> tokens [ ( $ stackPtr + 2 ) ] [ 'code' ] ) { $ classname = $ this -> get_namespaced_classname ( $ classname , ( $ stackPtr - 1 ) ) ; } } if ( \ T_DOUBLE_COLON === $ token [ 'code' ] ) { $ nameEnd = $ this -> phpcsFile -> findPrevious ( \ T_STRING , ( $ stackPtr - 1 ) ) ; $ nameStart = ( $ this -> phpcsFile -> findPrevious ( array ( \ T_STRING , \ T_NS_SEPARATOR , \ T_NAMESPACE ) , ( $ nameEnd - 1 ) , null , true , null , true ) + 1 ) ; $ length = ( $ nameEnd - ( $ nameStart - 1 ) ) ; $ classname = $ this -> phpcsFile -> getTokensAsString ( $ nameStart , $ length ) ; if ( \ T_NS_SEPARATOR !== $ this -> tokens [ $ nameStart ] [ 'code' ] ) { $ classname = $ this -> get_namespaced_classname ( $ classname , ( $ nameStart - 1 ) ) ; } } // Stop if we couldn't determine a classname. if ( empty ( $ classname ) ) { return false ; } // Nothing to do if 'parent', 'self' or 'static'. if ( \ in_array ( $ classname , array ( 'parent' , 'self' , 'static' ) , true ) ) { return false ; } $ this -> classname = $ classname ; return true ; }
Determine if we have a valid classname for the target token.

@since 0.11.0 This logic was originally contained in the `process()` method.

@param int $stackPtr The position of the current token in the stack.

@return bool
Determine if we have a valid classname for the target token .