protected function check_policy( Token $token, $policy, $permissive_policy, $equal_policy, $non_equal_policy, callable $transform_token ) {

		// Short circuit.
		if ( $permissive_policy === $policy ) {
			return true;
		}

		$transformed = $transform_token( $token->value );

		return ( $equal_policy === $policy && $transformed === $token->value )
			|| ( $non_equal_policy === $policy && $transformed !== $token->value );
	}
protected function check_policy( Token $token, $policy, $permissive_policy, $equal_policy, $non_equal_policy, callable $transform_token ) {

		// Short circuit.
		if ( $permissive_policy === $policy ) {
			return true;
		}

		$transformed = $transform_token( $token->value );

		return ( $equal_policy === $policy && $transformed === $token->value )
			|| ( $non_equal_policy === $policy && $transformed !== $token->value );
	}
protected function check_policy ( Token $ token , $ policy , $ permissive_policy , $ equal_policy , $ non_equal_policy , callable $ transform_token ) { // Short circuit. if ( $ permissive_policy === $ policy ) { return true ; } $ transformed = $ transform_token ( $ token -> value ) ; return ( $ equal_policy === $ policy && $ transformed === $ token -> value ) || ( $ non_equal_policy === $ policy && $ transformed !== $ token -> value ) ; }
Check if the value of the token conforms to the given policy.

@param  Token    $token             Required.
@param  int      $policy            The policy to check.
@param  int      $permissive_policy ALLOW_* policy constant.
@param  int      $equal_policy      Policy constant to check when the transformed value is equal to the original token.
@param  int      $non_equal_policy  Policy constant to check when the transformed value is different from the original token.
@param  callable $transform_token   Function to transform the token value.

@return bool
Check if the value of the token conforms to the given policy .