mirror of
https://github.com/flarum/framework.git
synced 2024-12-11 21:43:38 +08:00
Clean up
Goddammit GitHub for Mac
This commit is contained in:
parent
41c5ed0acb
commit
f4ab018e2e
|
@ -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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user