]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Operator/PHP/Matches.php
💄 Add untagged list link to filter menu
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Operator / PHP / Matches.php
index 4768900ce23738bcf5436a981da5c9c736eb9863..bc0c3f8f76bed331d0125a1816d8323dd68caf34 100644 (file)
@@ -2,10 +2,20 @@
 
 namespace Wallabag\CoreBundle\Operator\PHP;
 
+/**
+ * Provides a "matches" operator used for tagging rules.
+ *
+ * It asserts that a given pattern is contained in a subject, in a
+ * case-insensitive way.
+ *
+ * This operator will be used to compile tagging rules in PHP, usable
+ * directly on Entry objects for instance.
+ * It's registered in RulerZ using a service (wallabag.operator.array.matches);
+ */
 class Matches
 {
     public function __invoke($subject, $pattern)
     {
-        return stripos($subject, $pattern) !== false;
+        return false !== stripos($subject, $pattern);
     }
 }