aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Operator/PHP
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2017-04-20 14:58:20 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2017-04-20 15:17:02 +0200
commitfdd725f58cfe96d9bb9454d0347f6ff847fce69d (patch)
tree7f70e8d3b766d8a8ffc7cd807ca7a2a16d5f2bda /src/Wallabag/CoreBundle/Operator/PHP
parent64f1d8f77a75332b731124c5ebab4bed7a512081 (diff)
downloadwallabag-fdd725f58cfe96d9bb9454d0347f6ff847fce69d.tar.gz
wallabag-fdd725f58cfe96d9bb9454d0347f6ff847fce69d.tar.zst
wallabag-fdd725f58cfe96d9bb9454d0347f6ff847fce69d.zip
Added notmatches operator for tagging rule
Diffstat (limited to 'src/Wallabag/CoreBundle/Operator/PHP')
-rw-r--r--src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php b/src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php
new file mode 100644
index 00000000..eecb43cc
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php
@@ -0,0 +1,21 @@
1<?php
2
3namespace Wallabag\CoreBundle\Operator\PHP;
4
5/**
6 * Provides a "notmatches" operator used for tagging rules.
7 *
8 * It asserts that a given pattern is not 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 NotMatches
16{
17 public function __invoke($subject, $pattern)
18 {
19 return stripos($subject, $pattern) === false;
20 }
21}