public function parseValue($value)
    {
        foreach ($this->valueMatchers as $matcher) {
            $regex = sprintf('/%s/u', $matcher['token']);
            $values = $matcher['params'];
            if (preg_match($regex, $value)) {
                if (is_callable($values['value'])) {
                    preg_match($regex, $value, $output);
                    $values['value'] = $values['value']($output[1]);
                } else {
                    $values['value'] = preg_replace($regex, $values['value'], $value);
                }
                $values['matched'] = $matcher['token'];

                return $values;
            }
        }

        throw new QueryParseException(sprintf('No matching value found for "%s"', $value));
    }
public function parseValue($value)
    {
        foreach ($this->valueMatchers as $matcher) {
            $regex = sprintf('/%s/u', $matcher['token']);
            $values = $matcher['params'];
            if (preg_match($regex, $value)) {
                if (is_callable($values['value'])) {
                    preg_match($regex, $value, $output);
                    $values['value'] = $values['value']($output[1]);
                } else {
                    $values['value'] = preg_replace($regex, $values['value'], $value);
                }
                $values['matched'] = $matcher['token'];

                return $values;
            }
        }

        throw new QueryParseException(sprintf('No matching value found for "%s"', $value));
    }
public function parseValue ( $ value ) { foreach ( $ this -> valueMatchers as $ matcher ) { $ regex = sprintf ( '/%s/u' , $ matcher [ 'token' ] ) ; $ values = $ matcher [ 'params' ] ; if ( preg_match ( $ regex , $ value ) ) { if ( is_callable ( $ values [ 'value' ] ) ) { preg_match ( $ regex , $ value , $ output ) ; $ values [ 'value' ] = $ values [ 'value' ] ( $ output [ 1 ] ) ; } else { $ values [ 'value' ] = preg_replace ( $ regex , $ values [ 'value' ] , $ value ) ; } $ values [ 'matched' ] = $ matcher [ 'token' ] ; return $ values ; } } throw new QueryParseException ( sprintf ( 'No matching value found for "%s"' , $ value ) ) ; }
This method uses the defined value matchers to parse a passed in value.

The following component parts will be returned in the array:
[
'value'    => <the value remaining after the parse>
'operator' => <the operator that should be used>
'matched'  => <the pattern that the value matched>
]

@param string $value Value to process

@throws QueryParseException

@return array Parsed values
This method uses the defined value matchers to parse a passed in value .