mirror of
https://github.com/flarum/core.git
synced 2025-07-09 19:06:23 +02:00
Clean up
Goddammit GitHub for Mac
This commit is contained in:
@ -1,24 +0,0 @@
|
|||||||
<?php namespace Flarum\Core\Search;
|
|
||||||
|
|
||||||
abstract class RegexGambit implements Gambit
|
|
||||||
{
|
|
||||||
protected $pattern;
|
|
||||||
|
|
||||||
public function apply($bit, SearcherInterface $searcher)
|
|
||||||
{
|
|
||||||
if ($matches = $this->match($bit)) {
|
|
||||||
list($negate) = array_splice($matches, 1, 1);
|
|
||||||
$this->conditions($searcher, $matches, !! $negate);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function match($bit)
|
|
||||||
{
|
|
||||||
if (preg_match('/^(-?)'.$this->pattern.'$/i', $bit, $matches)) {
|
|
||||||
return $matches;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract protected function conditions(SearcherInterface $searcher, array $matches, $negate);
|
|
||||||
}
|
|
Reference in New Issue
Block a user