PHP Class Flarum\Core\Search\AbstractRegexGambit

Inheritance: implements Flarum\Core\Search\GambitInterface
Show file Open project: flarum/core Class Usage Examples

Protected Properties

Property Type Description
$pattern string The regex pattern to match the bit against.

Public Methods

Method Description
apply ( AbstractSearch $search, $bit )

Protected Methods

Method Description
conditions ( AbstractSearch $search, array $matches, boolean $negate ) : mixed Apply conditions to the search, given that the gambit was matched.
match ( string $bit ) : array Match the bit against this gambit.

Method Details

apply() public method

public apply ( AbstractSearch $search, $bit )
$search AbstractSearch

conditions() abstract protected method

Apply conditions to the search, given that the gambit was matched.
abstract protected conditions ( AbstractSearch $search, array $matches, boolean $negate ) : mixed
$search AbstractSearch The search object.
$matches array An array of matches from the search bit.
$negate boolean Whether or not the bit was negated, and thus whether or not the conditions should be negated.
return mixed

match() protected method

Match the bit against this gambit.
protected match ( string $bit ) : array
$bit string
return array

Property Details

$pattern protected property

The regex pattern to match the bit against.
protected string $pattern
return string