mirror of
https://github.com/wallabag/wallabag.git
synced 2025-03-28 22:05:28 +00:00
25 lines
575 B
PHP
25 lines
575 B
PHP
<?php
|
|
|
|
namespace Wallabag\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;
|
|
*/
|
|
class NotMatches
|
|
{
|
|
public function __invoke($subject, $pattern)
|
|
{
|
|
if (null === $subject) {
|
|
return true;
|
|
}
|
|
|
|
return false === stripos($subject, $pattern);
|
|
}
|
|
}
|