diff --git a/core/modules/migrate/src/Plugin/MigrateDestinationPluginManager.php b/core/modules/migrate/src/Plugin/MigrateDestinationPluginManager.php index 32f74fe..090efd0 100644 --- a/core/modules/migrate/src/Plugin/MigrateDestinationPluginManager.php +++ b/core/modules/migrate/src/Plugin/MigrateDestinationPluginManager.php @@ -2,7 +2,6 @@ namespace Drupal\migrate\Plugin; -use Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException; use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; diff --git a/core/modules/migrate/src/Plugin/MigratePluginManager.php b/core/modules/migrate/src/Plugin/MigratePluginManager.php index 68ac392..b3645db 100644 --- a/core/modules/migrate/src/Plugin/MigratePluginManager.php +++ b/core/modules/migrate/src/Plugin/MigratePluginManager.php @@ -2,7 +2,6 @@ namespace Drupal\migrate\Plugin; -use Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException; use Drupal\Component\Plugin\Factory\DefaultFactory; use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Extension\ModuleHandlerInterface; diff --git a/core/modules/migrate/src/Plugin/MigrateSourcePluginManager.php b/core/modules/migrate/src/Plugin/MigrateSourcePluginManager.php index 6b2af97..b4601b2 100644 --- a/core/modules/migrate/src/Plugin/MigrateSourcePluginManager.php +++ b/core/modules/migrate/src/Plugin/MigrateSourcePluginManager.php @@ -2,12 +2,12 @@ namespace Drupal\migrate\Plugin; -use Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException; use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\migrate\Plugin\Discovery\AnnotatedClassDiscoveryAutomatedProviders; use Drupal\Core\Plugin\Discovery\ContainerDerivativeDiscoveryDecorator; use Drupal\migrate\Plugin\Discovery\ProviderFilterDecorator; +use Drupal\migrate\Plugin\Exception\BadPluginDefinitionException; /** * Plugin manager for migrate source plugins. @@ -60,7 +60,7 @@ protected function getDiscovery() { * plugins have more than one provider. This functionality will be moved to * core in https://www.drupal.org/node/2786355. * - * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException + * @throws \Drupal\migrate\Plugin\Exception\BadPluginDefinitionException */ protected function findDefinitions() { $definitions = $this->getDiscovery()->getDefinitions(); @@ -80,7 +80,7 @@ public function processDefinition(&$definition, $plugin_id) { parent::processDefinition($definition, $plugin_id); if (empty($definition['source_module'])) { - throw new InvalidPluginDefinitionException($plugin_id, sprintf('The %s plugin should define the %s property.', $definition['id'], 'source_module')); + throw new BadPluginDefinitionException($plugin_id, 'source_module'); } } diff --git a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationProvidersExistTest.php b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationProvidersExistTest.php index cc7dee1..5659a6e 100644 --- a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationProvidersExistTest.php +++ b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationProvidersExistTest.php @@ -2,7 +2,6 @@ namespace Drupal\Tests\migrate\Kernel\Plugin; -use Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException; use Drupal\KernelTests\FileSystemModuleDiscoveryDataProviderTrait; use Drupal\migrate\Plugin\Exception\BadPluginDefinitionException; use Drupal\migrate\Plugin\Migration; @@ -25,7 +24,7 @@ public function testSourceProvider() { $this->enableAllModules(); $this->enableModules(['migration_provider_test']); $source_plugin_manager = $this->container->get('plugin.manager.migrate.source'); - $this->setExpectedException(InvalidPluginDefinitionException::class, 'The no_source_module plugin should define the source_module property.'); + $this->setExpectedException(BadPluginDefinitionException::class, 'The no_source_module plugin should define the source_module property.'); $source_plugin_manager->getDefinitions(); } @@ -282,4 +281,5 @@ public function fieldPluginDefinitionsProvider() { */ class MockMigration extends Migration { public $provider; + } diff --git a/core/modules/migrate_drupal_ui/tests/modules/migration_provider_test/src/Plugin/migrate/destination/NoDestinationModule.php b/core/modules/migrate_drupal_ui/tests/modules/migration_provider_test/src/Plugin/migrate/destination/NoDestinationModule.php index 1ef4fd5..e661210 100644 --- a/core/modules/migrate_drupal_ui/tests/modules/migration_provider_test/src/Plugin/migrate/destination/NoDestinationModule.php +++ b/core/modules/migrate_drupal_ui/tests/modules/migration_provider_test/src/Plugin/migrate/destination/NoDestinationModule.php @@ -2,7 +2,6 @@ namespace Drupal\migration_provider_test\Plugin\migrate\destination; -use Drupal\migrate\Annotation\MigrateDestination; use Drupal\migrate\Plugin\migrate\destination\EntityContentBase; /**