mirror of
https://github.com/flarum/framework.git
synced 2025-05-12 17:22:38 +08:00
Clean up
Goddammit GitHub for Mac
This commit is contained in:
parent
a74b40fe47
commit
336c05e77a
@ -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…
x
Reference in New Issue
Block a user