Add new Helper to process Ignore Origin rules and RulerZ operator

This commits adds a new helper like RuleBasedTagger for processing
ignore origin rules. It also adds a new custom RulerZ operator for the
'~' pattern matching rule.

Renames 'pattern' with '_all' in IgnoreOriginRule entity.

Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
This commit is contained in:
Kevin Decherf
2019-08-11 23:51:55 +02:00
parent 24230a5130
commit f39c5a2a70
6 changed files with 300 additions and 4 deletions

View File

@ -11,7 +11,6 @@ use Symfony\Component\Validator\Constraints as Assert;
*
* @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\IgnoreOriginInstanceRuleRepository")
* @ORM\Table(name="`ignore_origin_instance_rule`")
* @ORM\Entity
*/
class IgnoreOriginInstanceRule implements IgnoreOriginRuleInterface, RuleInterface
{
@ -30,7 +29,7 @@ class IgnoreOriginInstanceRule implements IgnoreOriginRuleInterface, RuleInterfa
* @Assert\NotBlank()
* @Assert\Length(max=255)
* @RulerZAssert\ValidRule(
* allowed_variables={"host","pattern"},
* allowed_variables={"host","_all"},
* allowed_operators={"=","~"}
* )
* @ORM\Column(name="rule", type="string", nullable=false)

View File

@ -11,7 +11,6 @@ use Symfony\Component\Validator\Constraints as Assert;
*
* @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\IgnoreOriginUserRuleRepository")
* @ORM\Table(name="`ignore_origin_user_rule`")
* @ORM\Entity
*/
class IgnoreOriginUserRule implements IgnoreOriginRuleInterface, RuleInterface
{
@ -30,7 +29,7 @@ class IgnoreOriginUserRule implements IgnoreOriginRuleInterface, RuleInterface
* @Assert\NotBlank()
* @Assert\Length(max=255)
* @RulerZAssert\ValidRule(
* allowed_variables={"host","pattern"},
* allowed_variables={"host","_all"},
* allowed_operators={"=","~"}
* )
* @ORM\Column(name="rule", type="string", nullable=false)