TreenodeRegexMatcher
in package
implements
TreenodeMatcher
Matches a node which has a specific key containing a specific value
Table of Contents
Interfaces
- TreenodeMatcher
- Interface for matching nodes in the treenode
Properties
Methods
- __construct() : mixed
- Constructor
- ascend() : mixed
- Called after children have been processed
- descend() : bool
- Returns true if the children of the specified node should be searched, false otherwise.
- match() : bool
- Does the match
Properties
$flags
private
mixed
$flags
$key
private
mixed
$key
$regex
private
mixed
$regex
Methods
__construct()
Constructor
public
__construct(string $key, mixed $regex[, string $flags = 'i' ]) : mixed
Parameters
- $key : string
-
The key to search
- $regex : mixed
-
The regex to search with. Should not contain leading or trailing slashes.
- $flags : string = 'i'
-
The regex flags to use. Defaults to 'i' (case-insensitive).
ascend()
Called after children have been processed
public
ascend(Treenode $node) : mixed
Parameters
- $node : Treenode
-
The treenode which has just ascended.
descend()
Returns true if the children of the specified node should be searched, false otherwise.
public
descend(Treenode $node) : bool
Parameters
- $node : Treenode
-
The treenode which is about to be descended into
Return values
bool —True descending should proceed, false otherwise
match()
Does the match
public
match(Treenode $node) : bool
Parameters
- $node : Treenode
-
The treenode to do matching against
Return values
bool —True if the node matches, false otherwise