public function is_class_property( $stackPtr ) {
		if ( ! isset( $this->tokens[ $stackPtr ] ) || \T_VARIABLE !== $this->tokens[ $stackPtr ]['code'] ) {
			return false;
		}

		// Note: interfaces can not declare properties.
		$valid_scopes = array(
			'T_CLASS'      => true,
			'T_ANON_CLASS' => true,
			'T_TRAIT'      => true,
		);

		$scopePtr = $this->valid_direct_scope( $stackPtr, $valid_scopes );
		if ( false !== $scopePtr ) {
			// Make sure it's not a method parameter.
			if ( empty( $this->tokens[ $stackPtr ]['nested_parenthesis'] ) ) {
				return true;
			} else {
				$parenthesis  = array_keys( $this->tokens[ $stackPtr ]['nested_parenthesis'] );
				$deepest_open = array_pop( $parenthesis );
				if ( $deepest_open < $scopePtr
					|| isset( $this->tokens[ $deepest_open ]['parenthesis_owner'] ) === false
					|| \T_FUNCTION !== $this->tokens[ $this->tokens[ $deepest_open ]['parenthesis_owner'] ]['code']
				) {
					return true;
				}
			}
		}

		return false;
	}
public function is_class_property( $stackPtr ) {
		if ( ! isset( $this->tokens[ $stackPtr ] ) || \T_VARIABLE !== $this->tokens[ $stackPtr ]['code'] ) {
			return false;
		}

		// Note: interfaces can not declare properties.
		$valid_scopes = array(
			'T_CLASS'      => true,
			'T_ANON_CLASS' => true,
			'T_TRAIT'      => true,
		);

		$scopePtr = $this->valid_direct_scope( $stackPtr, $valid_scopes );
		if ( false !== $scopePtr ) {
			// Make sure it's not a method parameter.
			if ( empty( $this->tokens[ $stackPtr ]['nested_parenthesis'] ) ) {
				return true;
			} else {
				$parenthesis  = array_keys( $this->tokens[ $stackPtr ]['nested_parenthesis'] );
				$deepest_open = array_pop( $parenthesis );
				if ( $deepest_open < $scopePtr
					|| isset( $this->tokens[ $deepest_open ]['parenthesis_owner'] ) === false
					|| \T_FUNCTION !== $this->tokens[ $this->tokens[ $deepest_open ]['parenthesis_owner'] ]['code']
				) {
					return true;
				}
			}
		}

		return false;
	}
public function is_class_property ( $ stackPtr ) { if ( ! isset ( $ this -> tokens [ $ stackPtr ] ) || \ T_VARIABLE !== $ this -> tokens [ $ stackPtr ] [ 'code' ] ) { return false ; } // Note: interfaces can not declare properties. $ valid_scopes = array ( 'T_CLASS' => true , 'T_ANON_CLASS' => true , 'T_TRAIT' => true , ) ; $ scopePtr = $ this -> valid_direct_scope ( $ stackPtr , $ valid_scopes ) ; if ( false !== $ scopePtr ) { // Make sure it's not a method parameter. if ( empty ( $ this -> tokens [ $ stackPtr ] [ 'nested_parenthesis' ] ) ) { return true ; } else { $ parenthesis = array_keys ( $ this -> tokens [ $ stackPtr ] [ 'nested_parenthesis' ] ) ; $ deepest_open = array_pop ( $ parenthesis ) ; if ( $ deepest_open < $ scopePtr || isset ( $ this -> tokens [ $ deepest_open ] [ 'parenthesis_owner' ] ) === false || \ T_FUNCTION !== $ this -> tokens [ $ this -> tokens [ $ deepest_open ] [ 'parenthesis_owner' ] ] [ 'code' ] ) { return true ; } } } return false ; }
Check whether a T_VARIABLE token is a class property declaration.

@since 0.14.0

@param int $stackPtr  The position in the stack of the T_VARIABLE token to verify.

@return bool
Check whether a T_VARIABLE token is a class property declaration .