3 namespace Wallabag\CoreBundle\Operator\PHP
;
6 * Provides a "~" operator used for ignore origin rules.
8 * It asserts that a subject matches a given regexp pattern, in a
9 * case-insensitive way.
11 * This operator will be used to compile ignore origin rules in PHP, usable
12 * directly on Entry objects for instance.
13 * It's registered in RulerZ using a service (wallabag.operator.array.pattern_matches);
17 public function __invoke($subject, $pattern)
19 $count = preg_match("`$pattern`i", $subject);
21 return \
is_int($count) && $count > 0;