aboutsummaryrefslogblamecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Operator/PHP/Matches.php
blob: bc0c3f8f76bed331d0125a1816d8323dd68caf34 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14



                                           









                                                                               



                                                
                                                     

     
<?php

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 false !== stripos($subject, $pattern);
    }
}