diff --git a/src/Plugin/Condition/EntityIsOfBundle.php b/src/Plugin/Condition/EntityIsOfBundle.php index 1b0bd72..04c49ff 100644 --- a/src/Plugin/Condition/EntityIsOfBundle.php +++ b/src/Plugin/Condition/EntityIsOfBundle.php @@ -146,7 +146,7 @@ class EntityIsOfBundle extends RulesConditionBase implements ContainerFactoryPlu public function bundleListOptions() { $options = []; - $entity_types = $this->entityTypeManager()->getDefinitions(); + $entity_types = $this->entityTypeManager->getDefinitions(); foreach ($entity_types as $entity_type) { if ($bundle_entity_type = $entity_type->getBundleEntityType()) { diff --git a/src/Plugin/Condition/UserHasEntityFieldAccess.php b/src/Plugin/Condition/UserHasEntityFieldAccess.php index cbf79e8..f687d4d 100644 --- a/src/Plugin/Condition/UserHasEntityFieldAccess.php +++ b/src/Plugin/Condition/UserHasEntityFieldAccess.php @@ -151,7 +151,7 @@ class UserHasEntityFieldAccess extends RulesConditionBase implements ContainerFa * An array of access types. */ public function accessListOptions() { - return ['view' => t('View'), 'edit' => t('Edit')]; + return ['view' => $this->t('View'), 'edit' => $this->t('Edit')]; } } diff --git a/src/Plugin/Condition/UserHasRole.php b/src/Plugin/Condition/UserHasRole.php index d690396..d3d7a6f 100644 --- a/src/Plugin/Condition/UserHasRole.php +++ b/src/Plugin/Condition/UserHasRole.php @@ -2,11 +2,9 @@ namespace Drupal\rules\Plugin\Condition; -use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\rules\Core\RulesConditionBase; use Drupal\rules\Exception\InvalidArgumentException; use Drupal\user\UserInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; /** * Provides a 'User has roles(s)' condition. @@ -36,7 +34,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; * * @todo: Add access callback information from Drupal 7. */ -class UserHasRole extends RulesConditionBase implements ContainerFactoryPluginInterface { +class UserHasRole extends RulesConditionBase { /** * Evaluate if user has role(s). @@ -89,8 +87,8 @@ class UserHasRole extends RulesConditionBase implements ContainerFactoryPluginIn */ public function operationListOptions() { return [ - 'AND' => 'All selected roles (and)', - 'OR' => 'Any selected role (or)', + 'AND' => $this->t('All selected roles (and)'), + 'OR' => $this->t('Any selected role (or)'), ]; }