WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php
private function is_prefixed( $stackPtr, $name ) {
		foreach ( $this->validated_prefixes as $prefix ) {
			if ( stripos( $name, $prefix ) === 0 ) {
				$this->phpcsFile->recordMetric( $stackPtr, 'Prefix all globals: allowed prefixes', $prefix );
				return true;
			}
		}

		return false;
	}
private function is_prefixed( $stackPtr, $name ) {
		foreach ( $this->validated_prefixes as $prefix ) {
			if ( stripos( $name, $prefix ) === 0 ) {
				$this->phpcsFile->recordMetric( $stackPtr, 'Prefix all globals: allowed prefixes', $prefix );
				return true;
			}
		}

		return false;
	}
Check if a function/class/constant/variable name is prefixed with one of the expected prefixes.

@since 0.12.0
@since 0.14.0 Allows for other non-word characters as well as underscores to better support hook names.
@since 1.0.0  Does not require a word seperator anymore after a prefix.
This allows for improved code style independent checking,
i.e. allows for camelCase naming and the likes.
@since 1.0.1  - Added $stackPtr parameter.
- The function now also records metrics about the prefixes encountered.

@param int    $stackPtr The position of the token to record the metric against.
@param string $name     Name to check for a prefix.

@return bool True when the name is one of the prefixes or starts with an allowed prefix.
False otherwise.