aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php
blob: 68b2676fd8199c3d6cdfd44265956643dfb11504 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php

namespace Wallabag\CoreBundle\Operator\PHP;

/**
 * Provides a "notmatches" operator used for tagging rules.
 *
 * It asserts that a given pattern is not 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.notmatches);
 */
class NotMatches
{
    public function __invoke($subject, $pattern)
    {
        return stripos($subject, $pattern) === false;
    }
}