Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions config/schema/rules.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions rules.services.yml
Original file line number Diff line number Diff line change
@@ -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']
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@

/**
* @file
* Contains \Drupal\rules\Annotation\RulesDataProcessor.
* Contains \Drupal\rules\Annotation\DataProcessor.
*/

namespace Drupal\rules\Annotation;

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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

/**
* @file
* Contains \Drupal\rules\Annotation\RulesExpression.
* Contains \Drupal\rules\Annotation\Expression.
*/

namespace Drupal\rules\Annotation;

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.
Expand Down
2 changes: 1 addition & 1 deletion src/Context/DataProcessorManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Engine/ConditionExpressionContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
abstract class ConditionExpressionContainer extends RulesConditionBase implements ConditionExpressionContainerInterface, ContainerFactoryPluginInterface {

use RulesExpressionTrait;
use ExpressionTrait;

/**
* List of conditions that are evaluated.
Expand Down Expand Up @@ -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')
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Engine/ExpressionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
6 changes: 3 additions & 3 deletions src/Engine/ExpressionPluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
$this->alterInfo('rules_expression');
parent::__construct('Plugin/RulesExpression', $namespaces, $module_handler, 'Drupal\rules\Engine\ExpressionInterface', $plugin_definition_annotation_name);
public function __construct(\Traversable $namespaces, ModuleHandlerInterface $module_handler, $plugin_definition_annotation_name = 'Drupal\rules\Annotation\Expression') {
$this->alterInfo('expression');
parent::__construct('Plugin/Expression', $namespaces, $module_handler, 'Drupal\rules\Engine\ExpressionInterface', $plugin_definition_annotation_name);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Engine/ExpressionPluginManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

/**
* @file
* Contains \Drupal\rules\Engine\RulesExpressionTrait.
* Contains \Drupal\rules\Engine\ExpressionTrait.
*/

namespace Drupal\rules\Engine;

/**
* Provides base methods for Rules expression objects.
*/
trait RulesExpressionTrait {
trait ExpressionTrait {

/**
* @var \Drupal\rules\Engine\ExpressionPluginManager
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/RulesComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

/**
* @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;
use Drupal\rules\Context\ContextConfig;
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;
Expand All @@ -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.
Expand Down Expand Up @@ -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')
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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.
Expand Down Expand Up @@ -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')
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

/**
* @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;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
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;
Expand All @@ -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;

/**
Expand Down Expand Up @@ -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')
);
}

Expand Down
Loading