]> git.immae.eu Git - github/wallabag/wallabag.git/blame_incremental - src/Wallabag/CoreBundle/Operator/PHP/Matches.php
Fix reviews
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Operator / PHP / Matches.php
... / ...
CommitLineData
1<?php
2
3namespace Wallabag\CoreBundle\Operator\PHP;
4
5/**
6 * Provides a "matches" operator used for tagging rules.
7 *
8 * It asserts that a given pattern is contained in a subject, in a
9 * case-insensitive way.
10 *
11 * This operator will be used to compile tagging rules in PHP, usable
12 * directly on Entry objects for instance.
13 * It's registered in RulerZ using a service (wallabag.operator.array.matches);
14 */
15class Matches
16{
17 public function __invoke($subject, $pattern)
18 {
19 return stripos($subject, $pattern) !== false;
20 }
21}