From c02273f2bf57c6bb00c8590c3cb050b2c6cafab9 Mon Sep 17 00:00:00 2001 From: Steve Purkiss Date: Wed, 15 Apr 2015 17:00:33 +0200 Subject: [PATCH 1/2] Renaming RulesExpression->Expression and RulesDataProcessor->DataProcessor --- .../{RulesDataProcessor.php => DataProcessor.php} | 6 +++--- src/Annotation/{RulesExpression.php => Expression.php} | 6 +++--- src/Engine/ConditionExpressionContainer.php | 2 +- src/Engine/ExpressionInterface.php | 2 +- src/Engine/ExpressionPluginManager.php | 4 ++-- src/Engine/ExpressionPluginManagerInterface.php | 2 +- .../{RulesExpressionTrait.php => ExpressionTrait.php} | 4 ++-- .../NumericOffset.php | 4 ++-- .../{RulesExpression => Expression}/ActionSet.php | 10 +++++----- src/Plugin/{RulesExpression => Expression}/Rule.php | 10 +++++----- .../{RulesExpression => Expression}/RuleInterface.php | 4 ++-- .../{RulesExpression => Expression}/RulesAction.php | 10 +++++----- .../{RulesExpression => Expression}/RulesAnd.php | 6 +++--- .../{RulesExpression => Expression}/RulesCondition.php | 10 +++++----- src/Plugin/{RulesExpression => Expression}/RulesOr.php | 6 +++--- tests/src/Integration/Engine/AutoSaveTest.php | 2 +- tests/src/Integration/RulesIntegrationTestBase.php | 6 +++--- tests/src/Unit/ActionSetTest.php | 6 +++--- tests/src/Unit/ContextHandlerTraitTest.php | 2 +- tests/src/Unit/RuleTest.php | 6 +++--- tests/src/Unit/RulesAndTest.php | 4 ++-- tests/src/Unit/RulesConditionTest.php | 6 +++--- tests/src/Unit/RulesOrTest.php | 4 ++-- tests/src/Unit/RulesUnitTestBase.php | 10 +++++----- 24 files changed, 66 insertions(+), 66 deletions(-) rename src/Annotation/{RulesDataProcessor.php => DataProcessor.php} (80%) rename src/Annotation/{RulesExpression.php => Expression.php} (77%) rename src/Engine/{RulesExpressionTrait.php => ExpressionTrait.php} (86%) rename src/Plugin/{RulesDataProcessor => DataProcessor}/NumericOffset.php (83%) rename src/Plugin/{RulesExpression => Expression}/ActionSet.php (94%) rename src/Plugin/{RulesExpression => Expression}/Rule.php (97%) rename src/Plugin/{RulesExpression => Expression}/RuleInterface.php (95%) rename src/Plugin/{RulesExpression => Expression}/RulesAction.php (95%) rename src/Plugin/{RulesExpression => Expression}/RulesAnd.php (89%) rename src/Plugin/{RulesExpression => Expression}/RulesCondition.php (95%) rename src/Plugin/{RulesExpression => Expression}/RulesOr.php (87%) diff --git a/src/Annotation/RulesDataProcessor.php b/src/Annotation/DataProcessor.php similarity index 80% rename from src/Annotation/RulesDataProcessor.php rename to src/Annotation/DataProcessor.php index 8f7d5b5c..8d17e1bd 100644 --- a/src/Annotation/RulesDataProcessor.php +++ b/src/Annotation/DataProcessor.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\rules\Annotation\RulesDataProcessor. + * Contains \Drupal\rules\Annotation\DataProcessor. */ namespace Drupal\rules\Annotation; @@ -10,14 +10,14 @@ use Drupal\Component\Annotation\Plugin; /** - * Defines the RulesDataProcessor annotation class. + * Defines the DataProcessor annotation class. * * This annotation is used to identify plugins that want to alter variables * before they are passed on during Rules exceution. * * @Annotation */ -class RulesDataProcessor extends Plugin { +class DataProcessor extends Plugin { /** * The plugin ID. diff --git a/src/Annotation/RulesExpression.php b/src/Annotation/Expression.php similarity index 77% rename from src/Annotation/RulesExpression.php rename to src/Annotation/Expression.php index 45bfbafe..4a44f4a7 100644 --- a/src/Annotation/RulesExpression.php +++ b/src/Annotation/Expression.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\rules\Annotation\RulesExpression. + * Contains \Drupal\rules\Annotation\Expression. */ namespace Drupal\rules\Annotation; @@ -10,11 +10,11 @@ use Drupal\Component\Annotation\Plugin; /** - * Defines the RulesExpression annotation class. + * Defines the Expression annotation class. * * @Annotation */ -class RulesExpression extends Plugin { +class Expression extends Plugin { /** * The plugin ID. diff --git a/src/Engine/ConditionExpressionContainer.php b/src/Engine/ConditionExpressionContainer.php index 404b0a83..6cfc2663 100644 --- a/src/Engine/ConditionExpressionContainer.php +++ b/src/Engine/ConditionExpressionContainer.php @@ -18,7 +18,7 @@ */ abstract class ConditionExpressionContainer extends RulesConditionBase implements ConditionExpressionContainerInterface, ContainerFactoryPluginInterface { - use RulesExpressionTrait; + use ExpressionTrait; /** * List of conditions that are evaluated. diff --git a/src/Engine/ExpressionInterface.php b/src/Engine/ExpressionInterface.php index dda9700e..553c6737 100644 --- a/src/Engine/ExpressionInterface.php +++ b/src/Engine/ExpressionInterface.php @@ -14,7 +14,7 @@ /** * Defines the interface for Rules expressions. * - * @see \Drupal\rules\Plugin\RulesExpressionPluginManager + * @see \Drupal\rules\Plugin\ExpressionPluginManager */ interface ExpressionInterface extends ExecutableInterface, ContextAwarePluginInterface, ConfigurablePluginInterface { diff --git a/src/Engine/ExpressionPluginManager.php b/src/Engine/ExpressionPluginManager.php index 1d3753fc..f5babab4 100644 --- a/src/Engine/ExpressionPluginManager.php +++ b/src/Engine/ExpressionPluginManager.php @@ -27,9 +27,9 @@ class ExpressionPluginManager extends DefaultPluginManager implements Expression /** * {@inheritdoc} */ - public function __construct(\Traversable $namespaces, ModuleHandlerInterface $module_handler, $plugin_definition_annotation_name = 'Drupal\rules\Annotation\RulesExpression') { + public function __construct(\Traversable $namespaces, ModuleHandlerInterface $module_handler, $plugin_definition_annotation_name = 'Drupal\rules\Annotation\Expression') { $this->alterInfo('rules_expression'); - parent::__construct('Plugin/RulesExpression', $namespaces, $module_handler, 'Drupal\rules\Engine\ExpressionInterface', $plugin_definition_annotation_name); + parent::__construct('Plugin/Expression', $namespaces, $module_handler, 'Drupal\rules\Engine\ExpressionInterface', $plugin_definition_annotation_name); } /** diff --git a/src/Engine/ExpressionPluginManagerInterface.php b/src/Engine/ExpressionPluginManagerInterface.php index f428cb1d..4598181b 100644 --- a/src/Engine/ExpressionPluginManagerInterface.php +++ b/src/Engine/ExpressionPluginManagerInterface.php @@ -20,7 +20,7 @@ interface ExpressionPluginManagerInterface extends PluginManagerInterface { * @param array $configuration * The configuration array to create the plugin instance with. * - * @return \Drupal\rules\Plugin\RulesExpression\RuleInterface + * @return \Drupal\rules\Plugin\Expression\RuleInterface * The created rule. */ public function createRule(array $configuration = []); diff --git a/src/Engine/RulesExpressionTrait.php b/src/Engine/ExpressionTrait.php similarity index 86% rename from src/Engine/RulesExpressionTrait.php rename to src/Engine/ExpressionTrait.php index fa9de4db..292ab5fa 100644 --- a/src/Engine/RulesExpressionTrait.php +++ b/src/Engine/ExpressionTrait.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\rules\Engine\RulesExpressionTrait. + * Contains \Drupal\rules\Engine\ExpressionTrait. */ namespace Drupal\rules\Engine; @@ -10,7 +10,7 @@ /** * Provides base methods for Rules expression objects. */ -trait RulesExpressionTrait { +trait ExpressionTrait { /** * @var \Drupal\rules\Engine\ExpressionPluginManager diff --git a/src/Plugin/RulesDataProcessor/NumericOffset.php b/src/Plugin/DataProcessor/NumericOffset.php similarity index 83% rename from src/Plugin/RulesDataProcessor/NumericOffset.php rename to src/Plugin/DataProcessor/NumericOffset.php index ba1688a3..59274089 100644 --- a/src/Plugin/RulesDataProcessor/NumericOffset.php +++ b/src/Plugin/DataProcessor/NumericOffset.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\rules\Plugin\RulesDataProcessor\NumericOffset. + * Contains \Drupal\rules\Plugin\DataProcessor\NumericOffset. */ -namespace Drupal\rules\Plugin\RulesDataProcessor; +namespace Drupal\rules\Plugin\DataProcessor; use Drupal\Core\Plugin\PluginBase; use Drupal\rules\Context\DataProcessorInterface; diff --git a/src/Plugin/RulesExpression/ActionSet.php b/src/Plugin/Expression/ActionSet.php similarity index 94% rename from src/Plugin/RulesExpression/ActionSet.php rename to src/Plugin/Expression/ActionSet.php index 3c3f3239..8a4fcf3b 100644 --- a/src/Plugin/RulesExpression/ActionSet.php +++ b/src/Plugin/Expression/ActionSet.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\rules\Plugin\RulesExpression\ActionSet. + * Contains \Drupal\rules\Plugin\Expression\ActionSet. */ -namespace Drupal\rules\Plugin\RulesExpression; +namespace Drupal\rules\Plugin\Expression; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\rules\Core\RulesActionBase; @@ -13,7 +13,7 @@ use Drupal\rules\Engine\ActionExpressionContainerInterface; use Drupal\rules\Engine\ActionExpressionInterface; use Drupal\rules\Engine\ExpressionInterface; -use Drupal\rules\Engine\RulesExpressionTrait; +use Drupal\rules\Engine\ExpressionTrait; use Drupal\rules\Engine\RulesState; use Drupal\rules\Exception\InvalidExpressionException; use Drupal\rules\Engine\ExpressionPluginManager; @@ -22,14 +22,14 @@ /** * Holds a set of actions and executes all of them. * - * @RulesExpression( + * @Expression( * id = "rules_action_set", * label = @Translation("Action set") * ) */ class ActionSet extends RulesActionBase implements ActionExpressionContainerInterface, ContainerFactoryPluginInterface { - use RulesExpressionTrait; + use ExpressionTrait; /** * List of actions that will be executed. diff --git a/src/Plugin/RulesExpression/Rule.php b/src/Plugin/Expression/Rule.php similarity index 97% rename from src/Plugin/RulesExpression/Rule.php rename to src/Plugin/Expression/Rule.php index 7c02568f..9075a866 100644 --- a/src/Plugin/RulesExpression/Rule.php +++ b/src/Plugin/Expression/Rule.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\rules\Plugin\RulesExpression\Rule. + * Contains \Drupal\rules\Plugin\Expression\Rule. */ -namespace Drupal\rules\Plugin\RulesExpression; +namespace Drupal\rules\Plugin\Expression; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Plugin\Context\ContextDefinition; @@ -16,7 +16,7 @@ use Drupal\rules\Engine\ActionExpressionInterface; use Drupal\rules\Engine\ConditionExpressionInterface; use Drupal\rules\Engine\ExpressionInterface; -use Drupal\rules\Engine\RulesExpressionTrait; +use Drupal\rules\Engine\ExpressionTrait; use Drupal\rules\Engine\RulesState; use Drupal\rules\Exception\InvalidExpressionException; use Drupal\rules\Engine\ExpressionPluginManager; @@ -29,14 +29,14 @@ * nest several rules into one rule. This is the functionality of so called * "rule sets" in Drupal 7. * - * @RulesExpression( + * @Expression( * id = "rules_rule", * label = @Translation("A rule, executing actions when conditions are met.") * ) */ class Rule extends RulesActionBase implements RuleInterface, ContainerFactoryPluginInterface { - use RulesExpressionTrait; + use ExpressionTrait; /** * List of conditions that must be met before actions are executed. diff --git a/src/Plugin/RulesExpression/RuleInterface.php b/src/Plugin/Expression/RuleInterface.php similarity index 95% rename from src/Plugin/RulesExpression/RuleInterface.php rename to src/Plugin/Expression/RuleInterface.php index acb4e30f..e2e96ef4 100644 --- a/src/Plugin/RulesExpression/RuleInterface.php +++ b/src/Plugin/Expression/RuleInterface.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\rules\RuleInterface. + * Contains \Drupal\rules\Plugin\Expression\RuleInterface. */ -namespace Drupal\rules\Plugin\RulesExpression; +namespace Drupal\rules\Plugin\Expression; use Drupal\rules\Context\ContextConfig; use Drupal\rules\Engine\ActionExpressionContainerInterface; diff --git a/src/Plugin/RulesExpression/RulesAction.php b/src/Plugin/Expression/RulesAction.php similarity index 95% rename from src/Plugin/RulesExpression/RulesAction.php rename to src/Plugin/Expression/RulesAction.php index e2001ee7..539f7a1f 100644 --- a/src/Plugin/RulesExpression/RulesAction.php +++ b/src/Plugin/Expression/RulesAction.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\rules\Plugin\RulesExpression\RulesAction. + * Contains \Drupal\rules\Plugin\Expression\RulesAction. */ -namespace Drupal\rules\Plugin\RulesExpression; +namespace Drupal\rules\Plugin\Expression; use Drupal\Component\Plugin\Exception\ContextException; use Drupal\Core\Action\ActionManager; @@ -13,7 +13,7 @@ use Drupal\rules\Context\ContextHandlerTrait; use Drupal\rules\Core\RulesActionBase; use Drupal\rules\Engine\ActionExpressionInterface; -use Drupal\rules\Engine\RulesExpressionTrait; +use Drupal\rules\Engine\ExpressionTrait; use Drupal\rules\Engine\RulesState; use Drupal\rules\Context\DataProcessorManager; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -24,14 +24,14 @@ * This plugin is used to wrap action plugins and is responsible to setup all * the context necessary, instantiate the action plugin and to execute it. * - * @RulesExpression( + * @Expression( * id = "rules_action", * label = @Translation("An executable action.") * ) */ class RulesAction extends RulesActionBase implements ContainerFactoryPluginInterface, ActionExpressionInterface { - use RulesExpressionTrait; + use ExpressionTrait; use ContextHandlerTrait; /** diff --git a/src/Plugin/RulesExpression/RulesAnd.php b/src/Plugin/Expression/RulesAnd.php similarity index 89% rename from src/Plugin/RulesExpression/RulesAnd.php rename to src/Plugin/Expression/RulesAnd.php index ff49334f..b3a6e3e3 100644 --- a/src/Plugin/RulesExpression/RulesAnd.php +++ b/src/Plugin/Expression/RulesAnd.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\rules\Plugin\RulesExpression\RulesAnd. + * Contains \Drupal\rules\Plugin\Expression\RulesAnd. */ -namespace Drupal\rules\Plugin\RulesExpression; +namespace Drupal\rules\Plugin\Expression; use Drupal\rules\Engine\ConditionExpressionContainer; use Drupal\rules\Engine\RulesState; @@ -13,7 +13,7 @@ /** * Evaluates a group of conditions with a logical AND. * - * @RulesExpression( + * @Expression( * id = "rules_and", * label = @Translation("Condition set (AND)") * ) diff --git a/src/Plugin/RulesExpression/RulesCondition.php b/src/Plugin/Expression/RulesCondition.php similarity index 95% rename from src/Plugin/RulesExpression/RulesCondition.php rename to src/Plugin/Expression/RulesCondition.php index ec71a233..c858eb52 100644 --- a/src/Plugin/RulesExpression/RulesCondition.php +++ b/src/Plugin/Expression/RulesCondition.php @@ -2,17 +2,17 @@ /** * @file - * Contains \Drupal\rules\Plugin\RulesExpression\RulesCondition. + * Contains \Drupal\rules\Plugin\Expression\RulesCondition. */ -namespace Drupal\rules\Plugin\RulesExpression; +namespace Drupal\rules\Plugin\Expression; use Drupal\Core\Condition\ConditionManager; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\rules\Context\ContextHandlerTrait; use Drupal\rules\Core\RulesConditionBase; use Drupal\rules\Engine\ConditionExpressionInterface; -use Drupal\rules\Engine\RulesExpressionTrait; +use Drupal\rules\Engine\ExpressionTrait; use Drupal\rules\Engine\RulesState; use Drupal\rules\Context\DataProcessorManager; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -23,14 +23,14 @@ * This plugin is used to wrap condition plugins and is responsible to setup all * the context necessary, instantiate the condition plugin and to execute it. * - * @RulesExpression( + * @Expression( * id = "rules_condition", * label = @Translation("An executable condition.") * ) */ class RulesCondition extends RulesConditionBase implements ConditionExpressionInterface, ContainerFactoryPluginInterface { - use RulesExpressionTrait; + use ExpressionTrait; use ContextHandlerTrait; /** diff --git a/src/Plugin/RulesExpression/RulesOr.php b/src/Plugin/Expression/RulesOr.php similarity index 87% rename from src/Plugin/RulesExpression/RulesOr.php rename to src/Plugin/Expression/RulesOr.php index dff95cd8..6937490b 100644 --- a/src/Plugin/RulesExpression/RulesOr.php +++ b/src/Plugin/Expression/RulesOr.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\rules\Plugin\RulesExpression\RulesOr. + * Contains \Drupal\rules\Plugin\Expression\RulesOr. */ -namespace Drupal\rules\Plugin\RulesExpression; +namespace Drupal\rules\Plugin\Expression; use Drupal\rules\Engine\ConditionExpressionContainer; use Drupal\rules\Engine\RulesState; @@ -13,7 +13,7 @@ /** * Evaluates a group of conditions with a logical OR. * - * @RulesExpression( + * @Expression( * id = "rules_or", * label = @Translation("Condition set (OR)") * ) diff --git a/tests/src/Integration/Engine/AutoSaveTest.php b/tests/src/Integration/Engine/AutoSaveTest.php index 90fadc54..fa1aec44 100644 --- a/tests/src/Integration/Engine/AutoSaveTest.php +++ b/tests/src/Integration/Engine/AutoSaveTest.php @@ -22,7 +22,7 @@ class AutoSaveTest extends RulesEntityIntegrationTestBase { * Tests auto saving after an action execution. */ public function testActionAutoSave() { - $rule = $this->rulesExpressionManager->createRule([ + $rule = $this->expressionManager->createRule([ 'context_definitions' => [ 'entity' => [ 'type' => 'entity', diff --git a/tests/src/Integration/RulesIntegrationTestBase.php b/tests/src/Integration/RulesIntegrationTestBase.php index 378167da..e08cf615 100644 --- a/tests/src/Integration/RulesIntegrationTestBase.php +++ b/tests/src/Integration/RulesIntegrationTestBase.php @@ -54,7 +54,7 @@ abstract class RulesIntegrationTestBase extends UnitTestCase { /** * @var \Drupal\rules\Engine\ExpressionPluginManager */ - protected $rulesExpressionManager; + protected $expressionManager; /** * @var \Drupal\rules\Context\DataProcessorManager @@ -129,7 +129,7 @@ public function setUp() { $this->actionManager = new ActionManager($this->namespaces, $this->cacheBackend, $this->moduleHandler); $this->conditionManager = new ConditionManager($this->namespaces, $this->cacheBackend, $this->moduleHandler); - $this->rulesExpressionManager = new ExpressionPluginManager($this->namespaces, $this->moduleHandler); + $this->expressionManager = new ExpressionPluginManager($this->namespaces, $this->moduleHandler); $this->classResolver = $this->getMockBuilder('Drupal\Core\DependencyInjection\ClassResolverInterface') ->disableOriginalConstructor() @@ -153,7 +153,7 @@ public function setUp() { $container->set('path.alias_manager', $this->aliasManager); $container->set('plugin.manager.action', $this->actionManager); $container->set('plugin.manager.condition', $this->conditionManager); - $container->set('plugin.manager.rules_expression', $this->rulesExpressionManager); + $container->set('plugin.manager.expression', $this->expressionManager); $container->set('plugin.manager.rules_data_processor', $this->rulesDataProcessorManager); $container->set('typed_data_manager', $this->typedDataManager); $container->set('string_translation', $this->getStringTranslationStub()); diff --git a/tests/src/Unit/ActionSetTest.php b/tests/src/Unit/ActionSetTest.php index 7542436c..7d79b230 100644 --- a/tests/src/Unit/ActionSetTest.php +++ b/tests/src/Unit/ActionSetTest.php @@ -7,10 +7,10 @@ namespace Drupal\Tests\rules\Unit; -use Drupal\rules\Plugin\RulesExpression\ActionSet; +use Drupal\rules\Plugin\Expression\ActionSet; /** - * @coversDefaultClass \Drupal\rules\Plugin\RulesExpression\ActionSet + * @coversDefaultClass \Drupal\rules\Plugin\Expression\ActionSet * @group rules */ class ActionSetTest extends RulesUnitTestBase { @@ -18,7 +18,7 @@ class ActionSetTest extends RulesUnitTestBase { /** * The action set being tested. * - * @var \Drupal\rules\Plugin\RulesExpression\ActionSet + * @var \Drupal\rules\Plugin\Expression\ActionSet */ protected $actionSet; diff --git a/tests/src/Unit/ContextHandlerTraitTest.php b/tests/src/Unit/ContextHandlerTraitTest.php index 3ab49fe6..0f1d36b2 100644 --- a/tests/src/Unit/ContextHandlerTraitTest.php +++ b/tests/src/Unit/ContextHandlerTraitTest.php @@ -23,7 +23,7 @@ class ContextHandlerTraitTest extends RulesUnitTestBase { /** * The condition object being tested. * - * @var \Drupal\rules\Plugin\RulesExpression\RulesCondition + * @var \Drupal\rules\Plugin\Expression\RulesCondition */ protected $condition; diff --git a/tests/src/Unit/RuleTest.php b/tests/src/Unit/RuleTest.php index f6bedc24..a2ebd4fd 100644 --- a/tests/src/Unit/RuleTest.php +++ b/tests/src/Unit/RuleTest.php @@ -7,10 +7,10 @@ namespace Drupal\Tests\rules\Unit; -use Drupal\rules\Plugin\RulesExpression\Rule; +use Drupal\rules\Plugin\Expression\Rule; /** - * @coversDefaultClass \Drupal\rules\Plugin\RulesExpression\Rule + * @coversDefaultClass \Drupal\rules\Plugin\Expression\Rule * @group rules */ class RuleTest extends RulesUnitTestBase { @@ -25,7 +25,7 @@ class RuleTest extends RulesUnitTestBase { /** * The rule being tested. * - * @var \Drupal\rules\Plugin\RulesExpression\RuleInterface + * @var \Drupal\rules\Plugin\Expression\RuleInterface */ protected $rule; diff --git a/tests/src/Unit/RulesAndTest.php b/tests/src/Unit/RulesAndTest.php index 74003d76..b72767cf 100644 --- a/tests/src/Unit/RulesAndTest.php +++ b/tests/src/Unit/RulesAndTest.php @@ -7,10 +7,10 @@ namespace Drupal\Tests\rules\Unit; -use Drupal\rules\Plugin\RulesExpression\RulesAnd; +use Drupal\rules\Plugin\Expression\RulesAnd; /** - * @coversDefaultClass \Drupal\rules\Plugin\RulesExpression\RulesAnd + * @coversDefaultClass \Drupal\rules\Plugin\Expression\RulesAnd * @group rules */ class RulesAndTest extends RulesUnitTestBase { diff --git a/tests/src/Unit/RulesConditionTest.php b/tests/src/Unit/RulesConditionTest.php index b8ad2f6b..8bc119b8 100644 --- a/tests/src/Unit/RulesConditionTest.php +++ b/tests/src/Unit/RulesConditionTest.php @@ -8,11 +8,11 @@ namespace Drupal\Tests\rules\Unit; use Drupal\rules\Context\ContextConfig; -use Drupal\rules\Plugin\RulesExpression\RulesCondition; +use Drupal\rules\Plugin\Expression\RulesCondition; /** - * @coversDefaultClass \Drupal\rules\Plugin\RulesExpression\RulesCondition + * @coversDefaultClass \Drupal\rules\Plugin\Expression\RulesCondition * @group rules */ class RulesConditionTest extends RulesUnitTestBase { @@ -34,7 +34,7 @@ class RulesConditionTest extends RulesUnitTestBase { /** * The condition object being tested. * - * @var \Drupal\rules\Plugin\RulesExpression\RulesCondition + * @var \Drupal\rules\Plugin\Expression\RulesCondition */ protected $condition; diff --git a/tests/src/Unit/RulesOrTest.php b/tests/src/Unit/RulesOrTest.php index 10723da2..55f819a0 100644 --- a/tests/src/Unit/RulesOrTest.php +++ b/tests/src/Unit/RulesOrTest.php @@ -7,10 +7,10 @@ namespace Drupal\Tests\rules\Unit; -use Drupal\rules\Plugin\RulesExpression\RulesOr; +use Drupal\rules\Plugin\Expression\RulesOr; /** - * @coversDefaultClass \Drupal\rules\Plugin\RulesExpression\RulesOr + * @coversDefaultClass \Drupal\rules\Plugin\Expression\RulesOr * @group rules */ class RulesOrTest extends RulesUnitTestBase { diff --git a/tests/src/Unit/RulesUnitTestBase.php b/tests/src/Unit/RulesUnitTestBase.php index 5159200d..a4a3596c 100644 --- a/tests/src/Unit/RulesUnitTestBase.php +++ b/tests/src/Unit/RulesUnitTestBase.php @@ -185,13 +185,13 @@ protected function getMockStringTranslation() { * @param array $methods * (optional) The methods to mock. * - * @return \Drupal\rules\Plugin\RulesExpression\RuleInterface + * @return \Drupal\rules\Plugin\Expression\RuleInterface * The mocked rule. */ protected function getMockRule(array $methods = []) { $methods += ['getPluginId', 'getBasePluginId', 'getDerivativeId', 'getPluginDefinition']; - $rule = $this->getMockBuilder('Drupal\rules\Plugin\RulesExpression\Rule') + $rule = $this->getMockBuilder('Drupal\rules\Plugin\Expression\Rule') ->setMethods($methods) ->disableOriginalConstructor() ->getMock(); @@ -222,7 +222,7 @@ protected function getMockRule(array $methods = []) { protected function getMockAnd(array $methods = []) { $methods += ['getPluginId', 'getBasePluginId', 'getDerivativeId', 'getPluginDefinition']; - $and = $this->getMockBuilder('Drupal\rules\Plugin\RulesExpression\RulesAnd') + $and = $this->getMockBuilder('Drupal\rules\Plugin\Expression\RulesAnd') ->setMethods($methods) ->disableOriginalConstructor() ->getMock(); @@ -247,7 +247,7 @@ protected function getMockAnd(array $methods = []) { protected function getMockOr(array $methods = []) { $methods += ['getPluginId', 'getBasePluginId', 'getDerivativeId', 'getPluginDefinition']; - $or = $this->getMockBuilder('Drupal\rules\Plugin\RulesExpression\RulesOr') + $or = $this->getMockBuilder('Drupal\rules\Plugin\Expression\RulesOr') ->setMethods($methods) ->disableOriginalConstructor() ->getMock(); @@ -272,7 +272,7 @@ protected function getMockOr(array $methods = []) { protected function getMockActionSet(array $methods = []) { $methods += ['getPluginId', 'getBasePluginId', 'getDerivativeId', 'getPluginDefinition']; - $actions = $this->getMockBuilder('Drupal\rules\Plugin\RulesExpression\ActionSet') + $actions = $this->getMockBuilder('Drupal\rules\Plugin\Expression\ActionSet') ->setMethods($methods) ->disableOriginalConstructor() ->getMock(); From f1e77c132a4c46337fc545e64d710b003a529874 Mon Sep 17 00:00:00 2001 From: Steve Purkiss Date: Thu, 16 Apr 2015 09:49:13 +0200 Subject: [PATCH 2/2] Changing rules_expression->expression and rules_data_processor->data_processor --- config/schema/rules.schema.yml | 32 +++++++++---------- rules.services.yml | 4 +-- src/Context/DataProcessorManager.php | 2 +- src/Engine/ConditionExpressionContainer.php | 2 +- src/Engine/ExpressionPluginManager.php | 2 +- src/Entity/RulesComponent.php | 2 +- src/Plugin/Expression/ActionSet.php | 2 +- src/Plugin/Expression/Rule.php | 2 +- src/Plugin/Expression/RulesAction.php | 2 +- src/Plugin/Expression/RulesCondition.php | 2 +- src/Tests/RulesDrupalTestBase.php | 2 +- .../Integration/RulesIntegrationTestBase.php | 6 ++-- 12 files changed, 30 insertions(+), 30 deletions(-) diff --git a/config/schema/rules.schema.yml b/config/schema/rules.schema.yml index 008f8608..a365e47d 100644 --- a/config/schema/rules.schema.yml +++ b/config/schema/rules.schema.yml @@ -26,18 +26,18 @@ rules.component.*: type: string label: 'Rules expression plugin ID' configuration: - type: rules_expression.[%parent.expression_id] + type: expression.[%parent.expression_id] label: 'Configuration' -rules_expression: +expression: type: mapping label: 'Rules expression' id: type: string label: 'Plugin ID' -rules_expression.rules_condition: - type: rules_expression +expression.rules_condition: + type: expression label: "Rules condition configuration" mapping: id: @@ -50,8 +50,8 @@ rules_expression.rules_condition: type: boolean label: 'Negated' -rules_expression.rules_action: - type: rules_expression +expression.rules_action: + type: expression label: "Rules action configuration" mapping: id: @@ -61,8 +61,8 @@ rules_expression.rules_action: type: string label: 'Action plugin ID' -rules_expression.rules_and: - type: rules_expression +expression.rules_and: + type: expression label: 'Rules And' mapping: id: @@ -75,10 +75,10 @@ rules_expression.rules_and: type: sequence label: 'Conditions' sequence: - - type: rules_expression.[id] + - type: expression.[id] -rules_expression.rules_action_set: - type: rules_expression +expression.rules_action_set: + type: expression label: 'Action set' mapping: id: @@ -88,10 +88,10 @@ rules_expression.rules_action_set: type: sequence label: 'Actions' sequence: - - type: rules_expression.[id] + - type: expression.[id] -rules_expression.rules_rule: - type: rules_expression +expression.rules_rule: + type: expression label: "Rule" mapping: id: @@ -103,10 +103,10 @@ rules_expression.rules_rule: sequence: - type: rules.context.definition conditions: - type: rules_expression.[id] + type: expression.[id] label: 'Conditions' actions: - type: rules_expression.[id] + type: expression.[id] label: 'Actions' rules.context.definition: diff --git a/rules.services.yml b/rules.services.yml index 88d387b5..a342567d 100644 --- a/rules.services.yml +++ b/rules.services.yml @@ -1,7 +1,7 @@ services: - plugin.manager.rules_expression: + plugin.manager.expression: class: Drupal\rules\Engine\ExpressionPluginManager arguments: ['@container.namespaces', '@module_handler'] - plugin.manager.rules_data_processor: + plugin.manager.data_processor: class: Drupal\rules\Context\DataProcessorManager arguments: ['@container.namespaces', '@module_handler'] diff --git a/src/Context/DataProcessorManager.php b/src/Context/DataProcessorManager.php index 0665b683..942dea66 100644 --- a/src/Context/DataProcessorManager.php +++ b/src/Context/DataProcessorManager.php @@ -21,7 +21,7 @@ class DataProcessorManager extends DefaultPluginManager { * {@inheritdoc} */ public function __construct(\Traversable $namespaces, ModuleHandlerInterface $module_handler, $plugin_definition_annotation_name = 'Drupal\rules\Annotation\RulesDataProcessor') { - $this->alterInfo('rules_data_processor'); + $this->alterInfo('data_processor'); parent::__construct('Plugin/RulesDataProcessor', $namespaces, $module_handler, 'Drupal\rules\Context\DataProcessorInterface', $plugin_definition_annotation_name); } diff --git a/src/Engine/ConditionExpressionContainer.php b/src/Engine/ConditionExpressionContainer.php index 6cfc2663..2c54c4ed 100644 --- a/src/Engine/ConditionExpressionContainer.php +++ b/src/Engine/ConditionExpressionContainer.php @@ -58,7 +58,7 @@ public static function create(ContainerInterface $container, array $configuratio $configuration, $plugin_id, $plugin_definition, - $container->get('plugin.manager.rules_expression') + $container->get('plugin.manager.expression') ); } diff --git a/src/Engine/ExpressionPluginManager.php b/src/Engine/ExpressionPluginManager.php index f5babab4..fe73de42 100644 --- a/src/Engine/ExpressionPluginManager.php +++ b/src/Engine/ExpressionPluginManager.php @@ -28,7 +28,7 @@ class ExpressionPluginManager extends DefaultPluginManager implements Expression * {@inheritdoc} */ public function __construct(\Traversable $namespaces, ModuleHandlerInterface $module_handler, $plugin_definition_annotation_name = 'Drupal\rules\Annotation\Expression') { - $this->alterInfo('rules_expression'); + $this->alterInfo('expression'); parent::__construct('Plugin/Expression', $namespaces, $module_handler, 'Drupal\rules\Engine\ExpressionInterface', $plugin_definition_annotation_name); } diff --git a/src/Entity/RulesComponent.php b/src/Entity/RulesComponent.php index c27c336d..85301721 100644 --- a/src/Entity/RulesComponent.php +++ b/src/Entity/RulesComponent.php @@ -117,7 +117,7 @@ public function getExpression() { * The Rules expression manager. */ protected function getExpressionManager() { - return \Drupal::service('plugin.manager.rules_expression'); + return \Drupal::service('plugin.manager.expression'); } /** diff --git a/src/Plugin/Expression/ActionSet.php b/src/Plugin/Expression/ActionSet.php index 8a4fcf3b..9f315b0a 100644 --- a/src/Plugin/Expression/ActionSet.php +++ b/src/Plugin/Expression/ActionSet.php @@ -69,7 +69,7 @@ public static function create(ContainerInterface $container, array $configuratio $configuration, $plugin_id, $plugin_definition, - $container->get('plugin.manager.rules_expression') + $container->get('plugin.manager.expression') ); } diff --git a/src/Plugin/Expression/Rule.php b/src/Plugin/Expression/Rule.php index 9075a866..21af00a3 100644 --- a/src/Plugin/Expression/Rule.php +++ b/src/Plugin/Expression/Rule.php @@ -88,7 +88,7 @@ public static function create(ContainerInterface $container, array $configuratio $configuration, $plugin_id, $plugin_definition, - $container->get('plugin.manager.rules_expression') + $container->get('plugin.manager.expression') ); } diff --git a/src/Plugin/Expression/RulesAction.php b/src/Plugin/Expression/RulesAction.php index 539f7a1f..da3b913d 100644 --- a/src/Plugin/Expression/RulesAction.php +++ b/src/Plugin/Expression/RulesAction.php @@ -70,7 +70,7 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { return new static($configuration, $plugin_id, $plugin_definition, $container->get('plugin.manager.action'), - $container->get('plugin.manager.rules_data_processor') + $container->get('plugin.manager.data_processor') ); } diff --git a/src/Plugin/Expression/RulesCondition.php b/src/Plugin/Expression/RulesCondition.php index c858eb52..7c1a843b 100644 --- a/src/Plugin/Expression/RulesCondition.php +++ b/src/Plugin/Expression/RulesCondition.php @@ -73,7 +73,7 @@ public static function create(ContainerInterface $container, array $configuratio $plugin_id, $plugin_definition, $container->get('plugin.manager.condition'), - $container->get('plugin.manager.rules_data_processor') + $container->get('plugin.manager.data_processor') ); } diff --git a/src/Tests/RulesDrupalTestBase.php b/src/Tests/RulesDrupalTestBase.php index b7976f66..43fd1683 100644 --- a/src/Tests/RulesDrupalTestBase.php +++ b/src/Tests/RulesDrupalTestBase.php @@ -47,7 +47,7 @@ abstract class RulesDrupalTestBase extends KernelTestBase { */ public function setUp() { parent::setUp(); - $this->expressionManager = $this->container->get('plugin.manager.rules_expression'); + $this->expressionManager = $this->container->get('plugin.manager.expression'); $this->conditionManager = $this->container->get('plugin.manager.condition'); $this->typedDataManager = $this->container->get('typed_data_manager'); } diff --git a/tests/src/Integration/RulesIntegrationTestBase.php b/tests/src/Integration/RulesIntegrationTestBase.php index e08cf615..02a970a8 100644 --- a/tests/src/Integration/RulesIntegrationTestBase.php +++ b/tests/src/Integration/RulesIntegrationTestBase.php @@ -59,7 +59,7 @@ abstract class RulesIntegrationTestBase extends UnitTestCase { /** * @var \Drupal\rules\Context\DataProcessorManager */ - protected $rulesDataProcessorManager; + protected $dataProcessorManager; /** * All setup'ed namespaces. @@ -136,7 +136,7 @@ public function setUp() { ->getMock(); $this->typedDataManager = new TypedDataManager($this->namespaces, $this->cacheBackend, $this->moduleHandler, $this->classResolver); - $this->rulesDataProcessorManager = new DataProcessorManager($this->namespaces, $this->moduleHandler); + $this->dataProcessorManager = new DataProcessorManager($this->namespaces, $this->moduleHandler); $this->aliasManager = $this->getMockBuilder('Drupal\Core\Path\AliasManagerInterface') ->disableOriginalConstructor() @@ -154,7 +154,7 @@ public function setUp() { $container->set('plugin.manager.action', $this->actionManager); $container->set('plugin.manager.condition', $this->conditionManager); $container->set('plugin.manager.expression', $this->expressionManager); - $container->set('plugin.manager.rules_data_processor', $this->rulesDataProcessorManager); + $container->set('plugin.manager.data_processor', $this->dataProcessorManager); $container->set('typed_data_manager', $this->typedDataManager); $container->set('string_translation', $this->getStringTranslationStub());