protected function substringEvaluator($condition)
    {
        $conditionName = $condition['name'];
        $conditionValue = $condition['value'];
        $userValue = isset($this->userAttributes[$conditionName]) ? $this->userAttributes[$conditionName]: null;

        if (!is_string($conditionValue)) {
            $this->logger->log(Logger::WARNING, sprintf(
                logs::UNKNOWN_CONDITION_VALUE,
                json_encode($condition)
            ));
            return null;
        }

        if (!is_string($userValue)) {
            $this->logger->log(Logger::WARNING, sprintf(
                logs::UNEXPECTED_TYPE,
                json_encode($condition),
                gettype($userValue),
                $conditionName
            ));
            return null;
        }

        return strpos($userValue, $conditionValue) !== false;
    }
protected function substringEvaluator($condition)
    {
        $conditionName = $condition['name'];
        $conditionValue = $condition['value'];
        $userValue = isset($this->userAttributes[$conditionName]) ? $this->userAttributes[$conditionName]: null;

        if (!is_string($conditionValue)) {
            $this->logger->log(Logger::WARNING, sprintf(
                logs::UNKNOWN_CONDITION_VALUE,
                json_encode($condition)
            ));
            return null;
        }

        if (!is_string($userValue)) {
            $this->logger->log(Logger::WARNING, sprintf(
                logs::UNEXPECTED_TYPE,
                json_encode($condition),
                gettype($userValue),
                $conditionName
            ));
            return null;
        }

        return strpos($userValue, $conditionValue) !== false;
    }
protected function substringEvaluator ( $ condition ) { $ conditionName = $ condition [ 'name' ] ; $ conditionValue = $ condition [ 'value' ] ; $ userValue = isset ( $ this -> userAttributes [ $ conditionName ] ) ? $ this -> userAttributes [ $ conditionName ] : null ; if ( ! is_string ( $ conditionValue ) ) { $ this -> logger -> log ( Logger :: WARNING , sprintf ( logs :: UNKNOWN_CONDITION_VALUE , json_encode ( $ condition ) ) ) ; return null ; } if ( ! is_string ( $ userValue ) ) { $ this -> logger -> log ( Logger :: WARNING , sprintf ( logs :: UNEXPECTED_TYPE , json_encode ( $ condition ) , gettype ( $ userValue ) , $ conditionName ) ) ; return null ; } return strpos ( $ userValue , $ conditionValue ) !== false ; }
Evaluate the given substring than match condition for the given user attributes.

@param  object $condition

@return boolean true if the condition value is a substring of the user attribute value,
false if the condition value is not a substring of the user attribute value,
null if the condition value isn't a string or the user attribute value
isn't a string.
Evaluate the given substring than match condition for the given user attributes .