class SingleByteStringFunctions 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
parseContains(string $haystack, string $needle)

Convert a call to contains()

string
parseEndsWith(string $string, string $substring)

Convert a call to ends-with()

string
parseNotContains(string $haystack, string $needle)

Convert a call to not(contains())

string
parseNotEndsWith(string $string, string $substring)

Convert a call to not(ends-with())

string
parseNotStartsWith(string $string, string $substring)

Convert a call to not(starts-with())

string
parseStartsWith(string $string, string $substring)

Convert a call to starts-with()

string
parseStringLength(string $expr = '.')

Convert a call to string-length()

string
generateContains(string $haystack, string $needle, bool $bool)

Generate the code for a call to contains()

string
generateEndsWith(string $string, string $substring, bool $bool)

Generate the code for a call to ends-with()

string
generateEndsWithLiteral(string $string, string $substring, bool $bool)

Generate the code for a call to ends-with() where the second argument is a literal string

string
generateEndsWithExpression(string $string, string $substring, bool $bool)

Generate the code for a call to ends-with()

string
generateStartsWith(string $string, string $substring, bool $bool)

Generate the code for a call to starts-with()

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 37
string parseContains(string $haystack, string $needle)

Convert a call to contains()

Parameters

string $haystack

Expression for the haystack part of the call

string $needle

Expression for the needle part of the call

Return Value

string

at line 49
string parseEndsWith(string $string, string $substring)

Convert a call to ends-with()

Parameters

string $string

Expression for the string part of the call

string $substring

Expression for the substring part of the call

Return Value

string

at line 61
string parseNotContains(string $haystack, string $needle)

Convert a call to not(contains())

Parameters

string $haystack

Expression for the haystack part of the call

string $needle

Expression for the needle part of the call

Return Value

string

at line 73
string parseNotEndsWith(string $string, string $substring)

Convert a call to not(ends-with())

Parameters

string $string

Expression for the string part of the call

string $substring

Expression for the substring part of the call

Return Value

string

at line 85
string parseNotStartsWith(string $string, string $substring)

Convert a call to not(starts-with())

Parameters

string $string

Expression for the string part of the call

string $substring

Expression for the substring part of the call

Return Value

string

at line 97
string parseStartsWith(string $string, string $substring)

Convert a call to starts-with()

Parameters

string $string

Expression for the string part of the call

string $substring

Expression for the substring part of the call

Return Value

string

at line 108
string parseStringLength(string $expr = '.')

Convert a call to string-length()

Parameters

string $expr

Return Value

string

at line 121
protected string generateContains(string $haystack, string $needle, bool $bool)

Generate the code for a call to contains()

Parameters

string $haystack

Expression for the haystack part of the call

string $needle

Expression for the needle part of the call

bool $bool

Return value for a positive match

Return Value

string

at line 136
protected string generateEndsWith(string $string, string $substring, bool $bool)

Generate the code for a call to ends-with()

Parameters

string $string

Expression for the string part of the call

string $substring

Expression for the substring part of the call

bool $bool

Return value for a positive match

Return Value

string

at line 151
protected string generateEndsWithLiteral(string $string, string $substring, bool $bool)

Generate the code for a call to ends-with() where the second argument is a literal string

Parameters

string $string

Expression for the string part of the call

string $substring

Expression for a literal substring

bool $bool

Return value for a positive match

Return Value

string

at line 166
protected string generateEndsWithExpression(string $string, string $substring, bool $bool)

Generate the code for a call to ends-with()

Parameters

string $string

Expression for the string part of the call

string $substring

Expression for the substring part of the call

bool $bool

Return value for a positive match

Return Value

string

at line 181
protected string generateStartsWith(string $string, string $substring, bool $bool)

Generate the code for a call to starts-with()

Parameters

string $string

Expression for the string part of the call

string $substring

Expression for the substring part of the call

bool $bool

Return value for a positive match

Return Value

string