diff --git a/composer.json b/composer.json index fd301df..3152660 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "extra": { "drush": { "services": { - "drush.services.yml": "^10" + "drush.10-11.services.yml": "^10 || ^11" } } } diff --git a/drush.services.yml b/drush.10-11.services.yml similarity index 64% rename from drush.services.yml rename to drush.10-11.services.yml index fe76863..708e827 100644 --- a/drush.services.yml +++ b/drush.10-11.services.yml @@ -1,24 +1,21 @@ services: dgi_actions.commands: - class: \Drupal\dgi_actions\Commands\Generate + class: \Drupal\dgi_actions\Drush\Commands\Generate arguments: [ '@http_client', '@entity_type.manager', '@dgi_actions.utils', '@dgi_actions.dgiutils', '@islandora.utils', - '@logger.dgi_actions' + '@logger.channel.dgi_actions' ] tags: - { name: drush.command } dgi_actions.print_missing_identifier_entity_ids: - class: \Drupal\dgi_actions\Commands\PrintMissingEntityIds + class: \Drupal\dgi_actions\Drush\Commands\PrintMissingEntityIds arguments: [ '@entity_type.manager', '@dgi_actions.utils' ] tags: - { name: drush.command } - logger.dgi_actions: - parent: logger.channel_base - arguments: [ 'dgi_actions' ] diff --git a/modules/dgi_actions_ark_identifier/src/Plugin/Action/DeleteArkIdentifier.php b/modules/dgi_actions_ark_identifier/src/Plugin/Action/DeleteArkIdentifier.php index f925a28..fb41b4f 100644 --- a/modules/dgi_actions_ark_identifier/src/Plugin/Action/DeleteArkIdentifier.php +++ b/modules/dgi_actions_ark_identifier/src/Plugin/Action/DeleteArkIdentifier.php @@ -3,10 +3,10 @@ namespace Drupal\dgi_actions_ark_identifier\Plugin\Action; use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\dgi_actions_ezid\Utility\EzidTrait; use Drupal\dgi_actions\Plugin\Action\DeleteIdentifier; use Drupal\dgi_actions\Plugin\Action\HttpActionDeleteTrait; use Drupal\dgi_actions\Utility\IdentifierUtils; +use Drupal\dgi_actions_ezid\Utility\EzidTrait; use GuzzleHttp\ClientInterface; use GuzzleHttp\RequestOptions; use Psr\Http\Message\ResponseInterface; diff --git a/modules/dgi_actions_handle/drush.services.yml b/modules/dgi_actions_handle/drush.services.yml index bfc39e7..6ce5967 100644 --- a/modules/dgi_actions_handle/drush.services.yml +++ b/modules/dgi_actions_handle/drush.services.yml @@ -1,7 +1,7 @@ --- services: dgi_actions_handle.commands: - class: \Drupal\dgi_actions_handle\Commands\HandleCommands + class: \Drupal\dgi_actions_handle\Drush\Commands\HandleCommands arguments: ['@http_client', '@entity_type.manager', '@dgi_actions.utils'] tags: - { name: drush.command } diff --git a/modules/dgi_actions_handle/src/Commands/HandleCommands.php b/modules/dgi_actions_handle/src/Drush/Commands/HandleCommands.php similarity index 93% rename from modules/dgi_actions_handle/src/Commands/HandleCommands.php rename to modules/dgi_actions_handle/src/Drush/Commands/HandleCommands.php index db4ebaa..83fe70d 100644 --- a/modules/dgi_actions_handle/src/Commands/HandleCommands.php +++ b/modules/dgi_actions_handle/src/Drush/Commands/HandleCommands.php @@ -1,6 +1,6 @@ utils = $utils; } + /** + * {@inheritDoc} + */ + public static function create(ContainerInterface $container) : self { + return new static( + $container->get('http_client'), + $container->get('entity_type.manager'), + $container->get('dgi_actions.utils') + ); + } + /** * Validates the update command. * diff --git a/modules/dgi_actions_handle/src/Commands/Update.php b/modules/dgi_actions_handle/src/Drush/Commands/Update.php similarity index 98% rename from modules/dgi_actions_handle/src/Commands/Update.php rename to modules/dgi_actions_handle/src/Drush/Commands/Update.php index ed93681..2abaf47 100644 --- a/modules/dgi_actions_handle/src/Commands/Update.php +++ b/modules/dgi_actions_handle/src/Drush/Commands/Update.php @@ -1,6 +1,6 @@ ourLogger = $logger; } + /** + * {@inheritDoc} + */ + public static function create(ContainerInterface $container) : self { + return new static( + $container->get('http_client'), + $container->get('entity_type.manager'), + $container->get('dgi_actions.utils'), + $container->get('islandora.utils'), + $container->get('logger.channel.dgi_actions') + ); + } + /** * Generates missing identifiers for entities. * diff --git a/src/Commands/PrintMissingEntityIds.php b/src/Drush/Commands/PrintMissingEntityIds.php similarity index 91% rename from src/Commands/PrintMissingEntityIds.php rename to src/Drush/Commands/PrintMissingEntityIds.php index 3d35359..46dec55 100644 --- a/src/Commands/PrintMissingEntityIds.php +++ b/src/Drush/Commands/PrintMissingEntityIds.php @@ -1,6 +1,6 @@ identifierUtils = $identifier_utils; } + /** + * {@inheritDoc} + */ + public static function create(ContainerInterface $container) : self { + return new static( + $container->get('entity_type.manager'), + $container->get('dgi_actions.utils') + ); + } + /** * Prints entity IDs with missing identifiers. * diff --git a/src/Form/DataProfileDeleteForm.php b/src/Form/DataProfileDeleteForm.php index 2bc2a18..6d109c3 100644 --- a/src/Form/DataProfileDeleteForm.php +++ b/src/Form/DataProfileDeleteForm.php @@ -4,8 +4,8 @@ use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Url; use Drupal\Core\StringTranslation\TranslatableMarkup; +use Drupal\Core\Url; /** * Builds the form to delete Data Profile setting entities. diff --git a/src/Plugin/Action/IdentifierAction.php b/src/Plugin/Action/IdentifierAction.php index eafa4be..3f656a6 100644 --- a/src/Plugin/Action/IdentifierAction.php +++ b/src/Plugin/Action/IdentifierAction.php @@ -2,16 +2,16 @@ namespace Drupal\dgi_actions\Plugin\Action; -use Drupal\Core\Entity\EntityTypeManagerInterface; -use Drupal\dgi_actions\Entity\IdentifierInterface; -use Drupal\dgi_actions\Utility\IdentifierUtils; use Drupal\Core\Action\ConfigurableActionBase; -use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Entity\EntityInterface; +use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; -use Psr\Log\LoggerInterface; use Drupal\Core\Session\AccountInterface; +use Drupal\dgi_actions\Entity\IdentifierInterface; +use Drupal\dgi_actions\Utility\IdentifierUtils; +use Psr\Log\LoggerInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; /** * Base class for Identifier Actions. diff --git a/src/Plugin/Action/MintIdentifier.php b/src/Plugin/Action/MintIdentifier.php index 8b36cca..02b66d6 100644 --- a/src/Plugin/Action/MintIdentifier.php +++ b/src/Plugin/Action/MintIdentifier.php @@ -2,8 +2,8 @@ namespace Drupal\dgi_actions\Plugin\Action; -use Drupal\Core\Entity\FieldableEntityInterface; use Drupal\Core\Entity\Exception\UndefinedLinkTemplateException; +use Drupal\Core\Entity\FieldableEntityInterface; use Drupal\Core\Field\EntityReferenceFieldItemList; use Drupal\Core\Form\FormStateInterface; diff --git a/src/Plugin/Condition/EntityHasIdentifier.php b/src/Plugin/Condition/EntityHasIdentifier.php index 6fa6873..8652220 100644 --- a/src/Plugin/Condition/EntityHasIdentifier.php +++ b/src/Plugin/Condition/EntityHasIdentifier.php @@ -6,12 +6,12 @@ use Drupal\Core\Condition\ConditionPluginBase; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Entity\FieldableEntityInterface; -use Drupal\Core\StringTranslation\StringTranslationTrait; -use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Plugin\ContainerFactoryPluginInterface; +use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\dgi_actions\Utility\IdentifierUtils; use Psr\Log\LoggerInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; /** * Condition to check an Entity for an existing persistent identifier. diff --git a/src/Plugin/DataProfileManager.php b/src/Plugin/DataProfileManager.php index 38bad1b..4ffd01e 100644 --- a/src/Plugin/DataProfileManager.php +++ b/src/Plugin/DataProfileManager.php @@ -2,9 +2,9 @@ namespace Drupal\dgi_actions\Plugin; -use Drupal\Core\Plugin\DefaultPluginManager; use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Plugin\DefaultPluginManager; /** * Provides the Data profile plugin manager. diff --git a/src/Plugin/ServiceDataTypeManager.php b/src/Plugin/ServiceDataTypeManager.php index a1c1950..d875944 100644 --- a/src/Plugin/ServiceDataTypeManager.php +++ b/src/Plugin/ServiceDataTypeManager.php @@ -2,9 +2,9 @@ namespace Drupal\dgi_actions\Plugin; -use Drupal\Core\Plugin\DefaultPluginManager; use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\Core\Plugin\DefaultPluginManager; /** * Provides the Service data type plugin manager.