WordPress/AbstractClassRestrictionsSniff.php
public function process_token( $stackPtr ) {
		// Reset the temporary storage before processing the token.
		unset( $this->classname );

		$this->excluded_groups = $this->merge_custom_array( $this->exclude );
		if ( array_diff_key( $this->groups, $this->excluded_groups ) === array() ) {
			// All groups have been excluded.
			// Don't remove the listener as the exclude property can be changed inline.
			return;
		}

		if ( true === $this->is_targetted_token( $stackPtr ) ) {
			return $this->check_for_matches( $stackPtr );
		}
	}
public function process_token( $stackPtr ) {
		// Reset the temporary storage before processing the token.
		unset( $this->classname );

		$this->excluded_groups = $this->merge_custom_array( $this->exclude );
		if ( array_diff_key( $this->groups, $this->excluded_groups ) === array() ) {
			// All groups have been excluded.
			// Don't remove the listener as the exclude property can be changed inline.
			return;
		}

		if ( true === $this->is_targetted_token( $stackPtr ) ) {
			return $this->check_for_matches( $stackPtr );
		}
	}
Processes this test, when one of its tokens is encountered.

{@internal Unlike in the `AbstractFunctionRestrictionsSniff`,
we can't do a preliminary check on classes as at this point
we don't know the class name yet.}}

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

@return int|void Integer stack pointer to skip forward or void to continue
normal file processing.