class Comparisons extends AbstractConvertor

Properties

protected RecursiveParser $parser from  AbstractRecursiveMatcher

Methods

void
__construct(RecursiveParser $parser)

No description

mixed
recurse(string $str, string $restrict = '')

Parse given string and return its value

string
getAttributeName(string $expr)

Retrieve the attribute name from an attribute expression

string
normalizeNumber(string $sign, string $number)

Normalize a number representation

array
getMatchers()

Return the matchers configuration

string
parseEq(string $expr1, string $operator, string $expr2)

Convert an equality test

string
parseGt(string $expr1, string $expr2)

Convert a "greater than" comparison

string
parseGte(string $expr1, string $expr2)

Convert a "greater than or equal to" comparison

string
parseLt(string $expr1, string $expr2)

Convert a "less than" comparison

string
parseLte(string $expr1, string $expr2)

Convert a "less than or equal to" comparison

string
convertComparison(string $expr1, string $operator, string $expr2)

Convert a comparison

Details

void __construct(RecursiveParser $parser)

No description

Parameters

RecursiveParser $parser

Return Value

void

protected mixed recurse(string $str, string $restrict = '')

Parse given string and return its value

Parameters

string $str
string $restrict

Pipe-separated list of allowed matches (ignored if empty)

Return Value

mixed

in AbstractConvertor at line 20
protected string getAttributeName(string $expr)

Retrieve the attribute name from an attribute expression

Parameters

string $expr

XPath expression for an attribute, e.g. '@foo'

Return Value

string

Attribute name, e.g. 'foo'

in AbstractConvertor at line 32
protected string normalizeNumber(string $sign, string $number)

Normalize a number representation

Parameters

string $sign
string $number

Return Value

string

at line 15
array getMatchers()

Return the matchers configuration

Match name as key. Can be prefixed with a colon-separated list of groups, e.g. "Group:Name". Value must be a string or an array with the following elements:

  • regexp: the regular expression used to match input.
  • order: used to sort matchers. Defaults to 0.
  • groups: list of groups this match belongs to. Defaults to an empty array.
  • callback: called with the matched strings. Defaults to [$this, "parseX"] where X is the match name.

If the config is a string, the string is used for the "regexp" element.

Return Value

array

at line 38
string parseEq(string $expr1, string $operator, string $expr2)

Convert an equality test

Parameters

string $expr1
string $operator
string $expr2

Return Value

string

at line 59
string parseGt(string $expr1, string $expr2)

Convert a "greater than" comparison

Parameters

string $expr1
string $expr2

Return Value

string

at line 71
string parseGte(string $expr1, string $expr2)

Convert a "greater than or equal to" comparison

Parameters

string $expr1
string $expr2

Return Value

string

at line 83
string parseLt(string $expr1, string $expr2)

Convert a "less than" comparison

Parameters

string $expr1
string $expr2

Return Value

string

at line 95
string parseLte(string $expr1, string $expr2)

Convert a "less than or equal to" comparison

Parameters

string $expr1
string $expr2

Return Value

string

at line 108
protected string convertComparison(string $expr1, string $operator, string $expr2)

Convert a comparison

Parameters

string $expr1
string $operator
string $expr2

Return Value

string