From a6e27f74663637ecc4a4cf84028e6b5a3556a6ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Gomez?= Date: Fri, 13 Nov 2015 14:37:58 +0100 Subject: [PATCH] Add matches operator --- composer.json | 2 +- composer.lock | 18 +++++++++--------- src/Wallabag/CoreBundle/Entity/TaggingRule.php | 2 +- .../CoreBundle/Operator/Doctrine/Matches.php | 15 +++++++++++++++ .../CoreBundle/Operator/PHP/Matches.php | 11 +++++++++++ .../CoreBundle/Resources/config/services.yml | 10 ++++++++++ 6 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 src/Wallabag/CoreBundle/Operator/Doctrine/Matches.php create mode 100644 src/Wallabag/CoreBundle/Operator/PHP/Matches.php diff --git a/composer.json b/composer.json index 949f7e32b..8fc5ce5bf 100644 --- a/composer.json +++ b/composer.json @@ -58,7 +58,7 @@ "scheb/two-factor-bundle": "~1.4", "grandt/phpepub": "~4.0", "wallabag/php-mobi": "~1.0.0", - "kphoen/rulerz-bundle": "~0.9,>=0.9.1" + "kphoen/rulerz-bundle": "~0.10" }, "require-dev": { "doctrine/doctrine-fixtures-bundle": "~2.2.0", diff --git a/composer.lock b/composer.lock index 9a4397bad..eea3f8a0d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "9372aa161ce94f8b5506d7e9cc73a884", - "content-hash": "e703c21d623d708ff9528c298d7ab05f", + "hash": "fed9468f6c830b0f81899daad7670af7", + "content-hash": "394f8a6ca5162f2d2756dbbee0ff5aae", "packages": [ { "name": "doctrine/annotations", @@ -2731,22 +2731,22 @@ }, { "name": "kphoen/rulerz-bundle", - "version": "0.9.1", + "version": "0.11.0", "source": { "type": "git", "url": "https://github.com/K-Phoen/RulerZBundle.git", - "reference": "0d8d6ca57ebf2c914c967bc13cdf13c5ebb2de62" + "reference": "dcaaed69d8252fa1e3a25802f8cf697947570778" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/K-Phoen/RulerZBundle/zipball/0d8d6ca57ebf2c914c967bc13cdf13c5ebb2de62", - "reference": "0d8d6ca57ebf2c914c967bc13cdf13c5ebb2de62", + "url": "https://api.github.com/repos/K-Phoen/RulerZBundle/zipball/dcaaed69d8252fa1e3a25802f8cf697947570778", + "reference": "dcaaed69d8252fa1e3a25802f8cf697947570778", "shasum": "" }, "require": { "kphoen/rulerz": "~0.1, >=0.13.0", - "symfony/framework-bundle": "~2.3", - "symfony/validator": "~2.3" + "symfony/framework-bundle": "~2.3|~3.0", + "symfony/validator": "~2.3|~3.0" }, "require-dev": { "matthiasnoback/symfony-dependency-injection-test": "~0.7", @@ -2777,7 +2777,7 @@ "rulerz", "specification" ], - "time": "2015-11-11 15:37:07" + "time": "2015-11-13 13:00:14" }, { "name": "kriswallsmith/assetic", diff --git a/src/Wallabag/CoreBundle/Entity/TaggingRule.php b/src/Wallabag/CoreBundle/Entity/TaggingRule.php index 851af9329..4eab590fd 100644 --- a/src/Wallabag/CoreBundle/Entity/TaggingRule.php +++ b/src/Wallabag/CoreBundle/Entity/TaggingRule.php @@ -30,7 +30,7 @@ class TaggingRule * @Assert\NotBlank() * @RulerZAssert\ValidRule( * allowed_variables={"title", "url", "isArchived", "isStared", "content", "language", "mimetype", "readingTime", "domainName"}, - * allowed_operators={">", "<", ">=", "<=", "=", "is", "!=", "and", "not", "or"} + * allowed_operators={">", "<", ">=", "<=", "=", "is", "!=", "and", "not", "or", "matches"} * ) * @ORM\Column(name="rule", type="string", nullable=false) */ diff --git a/src/Wallabag/CoreBundle/Operator/Doctrine/Matches.php b/src/Wallabag/CoreBundle/Operator/Doctrine/Matches.php new file mode 100644 index 000000000..dc47c982a --- /dev/null +++ b/src/Wallabag/CoreBundle/Operator/Doctrine/Matches.php @@ -0,0 +1,15 @@ +