mirror of
https://github.com/wallabag/wallabag.git
synced 2024-05-20 10:08:04 +00:00
22 lines
496 B
PHP
22 lines
496 B
PHP
<?php
|
|
|
|
namespace Wallabag\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;
|
|
*/
|
|
class Matches
|
|
{
|
|
public function __invoke($subject, $pattern)
|
|
{
|
|
return false !== stripos($subject, $pattern);
|
|
}
|
|
}
|