diff --git a/core/modules/ban/src/Plugin/migrate/destination/BlockedIp.php b/core/modules/ban/src/Plugin/migrate/destination/BlockedIp.php index 2ff4a36..f1fede6 100644 --- a/core/modules/ban/src/Plugin/migrate/destination/BlockedIp.php +++ b/core/modules/ban/src/Plugin/migrate/destination/BlockedIp.php @@ -9,7 +9,7 @@ use Drupal\ban\BanIpManagerInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Plugin\migrate\destination\DestinationBase; use Drupal\migrate\Row; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -39,7 +39,7 @@ class BlockedIP extends DestinationBase implements ContainerFactoryPluginInterfa * The plugin ID. * @param mixed $plugin_definition * The plugin definiiton. - * @param \Drupal\migrate\Entity\MigrationInterface $migration + * @param \Drupal\migrate\MigrationInterface $migration * The current migration. * @param \Drupal\ban\BanIpManagerInterface $ban_manager * The IP manager service. diff --git a/core/modules/block/src/Plugin/migrate/process/BlockPluginId.php b/core/modules/block/src/Plugin/migrate/process/BlockPluginId.php index dd7980a..4ddcea1 100644 --- a/core/modules/block/src/Plugin/migrate/process/BlockPluginId.php +++ b/core/modules/block/src/Plugin/migrate/process/BlockPluginId.php @@ -9,7 +9,7 @@ use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\MigrateExecutableInterface; use Drupal\migrate\Plugin\MigrateProcessInterface; use Drupal\migrate\ProcessPluginBase; diff --git a/core/modules/block/src/Plugin/migrate/process/BlockTheme.php b/core/modules/block/src/Plugin/migrate/process/BlockTheme.php index c072b42..45bbc30 100644 --- a/core/modules/block/src/Plugin/migrate/process/BlockTheme.php +++ b/core/modules/block/src/Plugin/migrate/process/BlockTheme.php @@ -7,7 +7,7 @@ namespace Drupal\block\Plugin\migrate\process; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\MigrateExecutableInterface; use Drupal\migrate\ProcessPluginBase; use Drupal\migrate\Row; @@ -45,7 +45,7 @@ class BlockTheme extends ProcessPluginBase implements ContainerFactoryPluginInte * The plugin ID for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. - * @param \Drupal\migrate\Entity\MigrationInterface $migration + * @param \Drupal\migrate\MigrationInterface $migration * The migration entity. * @param \Drupal\Core\Config\Config $theme_config * The system.theme configuration factory object. diff --git a/core/modules/block/src/Plugin/migrate/process/BlockVisibility.php b/core/modules/block/src/Plugin/migrate/process/BlockVisibility.php index be20097..25114b1 100644 --- a/core/modules/block/src/Plugin/migrate/process/BlockVisibility.php +++ b/core/modules/block/src/Plugin/migrate/process/BlockVisibility.php @@ -9,7 +9,7 @@ use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\MigrateExecutableInterface; use Drupal\migrate\MigrateSkipRowException; use Drupal\migrate\Plugin\MigrateProcessInterface; diff --git a/core/modules/comment/src/Plugin/migrate/destination/EntityComment.php b/core/modules/comment/src/Plugin/migrate/destination/EntityComment.php index 7ebbc83..e52fa85 100644 --- a/core/modules/comment/src/Plugin/migrate/destination/EntityComment.php +++ b/core/modules/comment/src/Plugin/migrate/destination/EntityComment.php @@ -12,7 +12,7 @@ use Drupal\Core\Entity\Query\QueryFactory; use Drupal\Core\Field\FieldTypePluginManagerInterface; use Drupal\Core\State\StateInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\MigrateException; use Drupal\migrate\Plugin\migrate\destination\EntityContentBase; use Drupal\migrate\Row; diff --git a/core/modules/comment/src/Tests/Migrate/d7/MigrateCommentTypeTest.php b/core/modules/comment/src/Tests/Migrate/d7/MigrateCommentTypeTest.php index 409631d..ad2824a 100644 --- a/core/modules/comment/src/Tests/Migrate/d7/MigrateCommentTypeTest.php +++ b/core/modules/comment/src/Tests/Migrate/d7/MigrateCommentTypeTest.php @@ -61,7 +61,7 @@ public function testMigration() { $this->assertEntity('comment_node_test_content_type', 'Test content type comment'); // Validate that the source count and processed count match up. - /** @var \Drupal\migrate\Entity\MigrationInterface $migration */ + /** @var \Drupal\migrate\MigrationInterface $migration */ $migration = Migration::load('d7_comment_type'); $this->assertIdentical($migration->getSourcePlugin()->count(), $migration->getIdMap()->processedCount()); } diff --git a/core/modules/field/src/Tests/Migrate/d6/MigrateFieldTest.php b/core/modules/field/src/Tests/Migrate/d6/MigrateFieldTest.php index 47b8bbd..b62c8c2 100644 --- a/core/modules/field/src/Tests/Migrate/d6/MigrateFieldTest.php +++ b/core/modules/field/src/Tests/Migrate/d6/MigrateFieldTest.php @@ -97,7 +97,7 @@ public function testFields() { $this->assertIdentical("boolean", $field_storage->getType(), t('Field type is @fieldtype. It should be boolean.', array('@fieldtype' => $field_storage->getType()))); // Validate that the source count and processed count match up. - /** @var \Drupal\migrate\Entity\MigrationInterface $migration */ + /** @var \Drupal\migrate\MigrationInterface $migration */ $migration = Migration::load('d6_field'); $this->assertIdentical($migration->getSourcePlugin()->count(), $migration->getIdMap()->processedCount()); diff --git a/core/modules/field/src/Tests/Migrate/d7/MigrateFieldTest.php b/core/modules/field/src/Tests/Migrate/d7/MigrateFieldTest.php index 7daf734..82426bb 100644 --- a/core/modules/field/src/Tests/Migrate/d7/MigrateFieldTest.php +++ b/core/modules/field/src/Tests/Migrate/d7/MigrateFieldTest.php @@ -115,7 +115,7 @@ public function testFields() { $this->assertIdentical('taxonomy_term', $field->getSetting('target_type')); // Validate that the source count and processed count match up. - /** @var \Drupal\migrate\Entity\MigrationInterface $migration */ + /** @var \Drupal\migrate\MigrationInterface $migration */ $migration = Migration::load('d7_field'); $this->assertIdentical($migration->getSourcePlugin()->count(), $migration->getIdMap()->processedCount()); } diff --git a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldSettingsTest.php b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldSettingsTest.php index c0a12dd..eeed31a 100644 --- a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldSettingsTest.php +++ b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d6/FieldSettingsTest.php @@ -8,7 +8,7 @@ namespace Drupal\Tests\field\Unit\Plugin\migrate\process\d6; use Drupal\field\Plugin\migrate\process\d6\FieldSettings; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\MigrateExecutableInterface; use Drupal\migrate\Row; use Drupal\Tests\UnitTestCase; diff --git a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldInstanceSettingsTest.php b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldInstanceSettingsTest.php index 5bec59e..245e101 100644 --- a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldInstanceSettingsTest.php +++ b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldInstanceSettingsTest.php @@ -8,7 +8,7 @@ namespace Drupal\Tests\field\Unit\Plugin\migrate\process\d7; use Drupal\field\Plugin\migrate\process\d7\FieldInstanceSettings; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\MigrateExecutableInterface; use Drupal\migrate\Row; use Drupal\Tests\migrate\Unit\MigrateTestCase; diff --git a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldSettingsTest.php b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldSettingsTest.php index ca1b937..b5cd7f6 100644 --- a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldSettingsTest.php +++ b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldSettingsTest.php @@ -8,7 +8,7 @@ namespace Drupal\Tests\field\Unit\Plugin\migrate\process\d7; use Drupal\field\Plugin\migrate\process\d7\FieldSettings; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\MigrateExecutableInterface; use Drupal\migrate\Row; use Drupal\Tests\migrate\Unit\MigrateTestCase; diff --git a/core/modules/file/src/Plugin/migrate/cckfield/FileField.php b/core/modules/file/src/Plugin/migrate/cckfield/FileField.php index 022f01e..615e0af 100644 --- a/core/modules/file/src/Plugin/migrate/cckfield/FileField.php +++ b/core/modules/file/src/Plugin/migrate/cckfield/FileField.php @@ -7,7 +7,7 @@ namespace Drupal\file\Plugin\migrate\cckfield; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Row; use Drupal\migrate_drupal\Plugin\migrate\cckfield\CckFieldPluginBase; diff --git a/core/modules/file/src/Plugin/migrate/destination/EntityFile.php b/core/modules/file/src/Plugin/migrate/destination/EntityFile.php index 89667f1..b9387c1 100644 --- a/core/modules/file/src/Plugin/migrate/destination/EntityFile.php +++ b/core/modules/file/src/Plugin/migrate/destination/EntityFile.php @@ -15,7 +15,7 @@ use Drupal\Core\File\FileSystemInterface; use Drupal\Core\StreamWrapper\LocalStream; use Drupal\Core\StreamWrapper\StreamWrapperManagerInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Row; use Drupal\migrate\MigrateException; use Drupal\migrate\Plugin\migrate\destination\EntityContentBase; diff --git a/core/modules/file/src/Plugin/migrate/process/d6/CckFile.php b/core/modules/file/src/Plugin/migrate/process/d6/CckFile.php index 4270b79..ae51842 100644 --- a/core/modules/file/src/Plugin/migrate/process/d6/CckFile.php +++ b/core/modules/file/src/Plugin/migrate/process/d6/CckFile.php @@ -8,7 +8,7 @@ namespace Drupal\file\Plugin\migrate\process\d6; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\MigrateExecutableInterface; use Drupal\migrate\MigrateSkipRowException; use Drupal\migrate\Plugin\MigrateProcessInterface; @@ -39,7 +39,7 @@ class CckFile extends ProcessPluginBase implements ContainerFactoryPluginInterfa * The plugin ID. * @param mixed $plugin_definition * The plugin definition. - * @param \Drupal\migrate\Entity\MigrationInterface $migration + * @param \Drupal\migrate\MigrationInterface $migration * The current migration. * @param \Drupal\migrate\Plugin\MigrateProcessInterface $migration_plugin * An instance of the 'migration' process plugin. diff --git a/core/modules/file/src/Tests/Migrate/d6/MigrateFileTest.php b/core/modules/file/src/Tests/Migrate/d6/MigrateFileTest.php index 2bda4c0..b2fb13e 100644 --- a/core/modules/file/src/Tests/Migrate/d6/MigrateFileTest.php +++ b/core/modules/file/src/Tests/Migrate/d6/MigrateFileTest.php @@ -39,7 +39,7 @@ protected function setUp() { $this->installEntitySchema('file'); $this->installConfig(['file']); - /** @var \Drupal\migrate\Entity\MigrationInterface $migration */ + /** @var \Drupal\migrate\MigrationInterface $migration */ $migration = Migration::load('d6_file'); $source = $migration->get('source'); $source['site_path'] = 'core/modules/simpletest'; diff --git a/core/modules/file/src/Tests/Migrate/d7/MigrateFileTest.php b/core/modules/file/src/Tests/Migrate/d7/MigrateFileTest.php index 2d54d78..b3652bd 100644 --- a/core/modules/file/src/Tests/Migrate/d7/MigrateFileTest.php +++ b/core/modules/file/src/Tests/Migrate/d7/MigrateFileTest.php @@ -34,7 +34,7 @@ protected function setUp() { $fs->mkdir('public://sites/default/files', NULL, TRUE); file_put_contents('public://sites/default/files/cube.jpeg', str_repeat('*', 3620)); - /** @var \Drupal\migrate\Entity\MigrationInterface $migration */ + /** @var \Drupal\migrate\MigrationInterface $migration */ $migration = entity_load('migration', 'd7_file'); // Set the destination plugin's source_base_path configuration value, which // would normally be set by the user running the migration. diff --git a/core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/CckFileTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/CckFileTest.php index b98d3a9..c1f84ef 100644 --- a/core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/CckFileTest.php +++ b/core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/CckFileTest.php @@ -8,7 +8,7 @@ namespace Drupal\Tests\file\Unit\Plugin\migrate\process\d6; use Drupal\file\Plugin\migrate\process\d6\CckFile; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\MigrateExecutableInterface; use Drupal\migrate\Plugin\MigrateProcessInterface; use Drupal\migrate\Row; diff --git a/core/modules/filter/src/Plugin/migrate/process/d6/FilterFormatPermission.php b/core/modules/filter/src/Plugin/migrate/process/d6/FilterFormatPermission.php index 9ae5a71..7565fa1 100644 --- a/core/modules/filter/src/Plugin/migrate/process/d6/FilterFormatPermission.php +++ b/core/modules/filter/src/Plugin/migrate/process/d6/FilterFormatPermission.php @@ -9,7 +9,7 @@ namespace Drupal\filter\Plugin\migrate\process\d6; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\MigrateExecutableInterface; use Drupal\migrate\Plugin\MigrateProcessInterface; use Drupal\migrate\ProcessPluginBase; diff --git a/core/modules/image/src/Tests/Migrate/d6/MigrateImageCacheTest.php b/core/modules/image/src/Tests/Migrate/d6/MigrateImageCacheTest.php index 99ee292..e837998 100644 --- a/core/modules/image/src/Tests/Migrate/d6/MigrateImageCacheTest.php +++ b/core/modules/image/src/Tests/Migrate/d6/MigrateImageCacheTest.php @@ -10,7 +10,7 @@ use Drupal\Core\Database\Database; use Drupal\image\Entity\ImageStyle; use Drupal\migrate\Entity\Migration; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Exception\RequirementsException; use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; diff --git a/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php b/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php index 4ce022d..fd9da35 100644 --- a/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php +++ b/core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationContentEntity.php @@ -181,8 +181,8 @@ public function getLanguageSwitchLinks(Request $request, $type, Url $url) { * \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationContentEntity::processOutbound(). * * @return bool - * TRUE if the the content entity language negotiator has higher priority - * than the url language negotiator, FALSE otherwise. + * TRUE if the content entity language negotiator has higher priority than + * the url language negotiator, FALSE otherwise. */ protected function hasLowerLanguageNegotiationWeight() { if (!isset($this->hasLowerLanguageNegotiationWeightResult)) { diff --git a/core/modules/link/src/Plugin/migrate/cckfield/LinkField.php b/core/modules/link/src/Plugin/migrate/cckfield/LinkField.php index 327cbda..c0ad4a0 100644 --- a/core/modules/link/src/Plugin/migrate/cckfield/LinkField.php +++ b/core/modules/link/src/Plugin/migrate/cckfield/LinkField.php @@ -7,7 +7,7 @@ namespace Drupal\link\Plugin\migrate\cckfield; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate_drupal\Plugin\migrate\cckfield\CckFieldPluginBase; /** diff --git a/core/modules/link/src/Plugin/migrate/process/d6/CckLink.php b/core/modules/link/src/Plugin/migrate/process/d6/CckLink.php index d705671..1fe1d72 100644 --- a/core/modules/link/src/Plugin/migrate/process/d6/CckLink.php +++ b/core/modules/link/src/Plugin/migrate/process/d6/CckLink.php @@ -8,7 +8,7 @@ namespace Drupal\link\Plugin\migrate\process\d6; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\MigrateExecutableInterface; use Drupal\migrate\ProcessPluginBase; use Drupal\migrate\Row; diff --git a/core/modules/migrate/migrate.api.php b/core/modules/migrate/migrate.api.php index df5c66d..9ea543d 100644 --- a/core/modules/migrate/migrate.api.php +++ b/core/modules/migrate/migrate.api.php @@ -5,7 +5,7 @@ * Hooks provided by the Migrate module. */ -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Plugin\MigrateSourceInterface; use Drupal\migrate\Row; @@ -77,7 +77,7 @@ * The definition of how to migrate each type of data is stored in configuration * entities. The migration configuration entity class is * \Drupal\migrate\Entity\Migration, with interface - * \Drupal\migrate\Entity\MigrationInterface; the configuration schema can be + * \Drupal\migrate\MigrationInterface; the configuration schema can be * found in the migrate.schema.yml file. Migration configuration consists of IDs * and configuration for the source, process, and destination plugins, as well * as information on dependencies. Process configuration consists of sections, diff --git a/core/modules/migrate/migrate.services.yml b/core/modules/migrate/migrate.services.yml index 40270f6..c4e6633 100644 --- a/core/modules/migrate/migrate.services.yml +++ b/core/modules/migrate/migrate.services.yml @@ -26,3 +26,6 @@ services: plugin.manager.migrate.builder: class: Drupal\migrate\Plugin\MigratePluginManager arguments: [builder, '@container.namespaces', '@cache.discovery', '@module_handler'] + plugin.manager.migration: + class: Drupal\migrate\Plugin\MigrationPluginManager + arguments: ['@module_handler', '@cache.discovery', '@language_manager'] diff --git a/core/modules/migrate/src/Entity/Migration.php b/core/modules/migrate/src/Entity/Migration.php index 9e509f4..8f22367 100644 --- a/core/modules/migrate/src/Entity/Migration.php +++ b/core/modules/migrate/src/Entity/Migration.php @@ -11,6 +11,7 @@ use Drupal\migrate\Exception\RequirementsException; use Drupal\migrate\MigrateException; use Drupal\migrate\MigrateSkipRowException; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Plugin\MigrateIdMapInterface; use Drupal\migrate\Plugin\RequirementsInterface; use Drupal\Component\Utility\NestedArray; @@ -381,7 +382,7 @@ public function checkRequirements() { $this->getDestinationPlugin()->checkRequirements(); } - /** @var \Drupal\migrate\Entity\MigrationInterface[] $required_migrations */ + /** @var \Drupal\migrate\MigrationInterface[] $required_migrations */ $required_migrations = $this->getEntityManager()->getStorage('migration')->loadMultiple($this->requirements); $missing_migrations = array_diff($this->requirements, array_keys($required_migrations)); diff --git a/core/modules/migrate/src/Entity/MigrationInterface.php b/core/modules/migrate/src/Entity/MigrationInterface.php deleted file mode 100644 index a07c0ea..0000000 --- a/core/modules/migrate/src/Entity/MigrationInterface.php +++ /dev/null @@ -1,316 +0,0 @@ - $template) { @@ -49,7 +49,7 @@ public function createMigrations(array $templates) { $variants = array(Migration::create($template)); } - /** @var \Drupal\migrate\Entity\MigrationInterface[] $variants */ + /** @var \Drupal\migrate\MigrationInterface[] $variants */ foreach ($variants as $variant) { $variant->set('template', $template_id); } diff --git a/core/modules/migrate/src/MigrationInterface.php b/core/modules/migrate/src/MigrationInterface.php new file mode 100644 index 0000000..3b7b560 --- /dev/null +++ b/core/modules/migrate/src/MigrationInterface.php @@ -0,0 +1,314 @@ +getVariantIds($ids); } - /** @var \Drupal\migrate\Entity\MigrationInterface[] $migrations */ + /** @var \Drupal\migrate\MigrationInterface[] $migrations */ $migrations = parent::loadMultiple($ids); foreach ($migrations as $migration) { @@ -126,7 +126,7 @@ public function buildDependencyMigration(array $migrations, array $dynamic_ids) $requirement_graph = array(); $different = FALSE; foreach ($migrations as $migration) { - /** @var \Drupal\migrate\Entity\MigrationInterface $migration */ + /** @var \Drupal\migrate\MigrationInterface $migration */ $id = $migration->id(); $requirements[$id] = array(); $dependency_graph[$id]['edges'] = array(); diff --git a/core/modules/migrate/src/Plugin/MigrateBuilderInterface.php b/core/modules/migrate/src/Plugin/MigrateBuilderInterface.php index c615dd4..982bf53 100644 --- a/core/modules/migrate/src/Plugin/MigrateBuilderInterface.php +++ b/core/modules/migrate/src/Plugin/MigrateBuilderInterface.php @@ -23,7 +23,7 @@ * @param array $template * The parsed template. * - * @return \Drupal\migrate\Entity\MigrationInterface[] + * @return \Drupal\migrate\MigrationInterface[] * The unsaved migrations generated from the template. */ public function buildMigrations(array $template); diff --git a/core/modules/migrate/src/Plugin/MigrateDestinationInterface.php b/core/modules/migrate/src/Plugin/MigrateDestinationInterface.php index 08a12e5..4fcec0c 100644 --- a/core/modules/migrate/src/Plugin/MigrateDestinationInterface.php +++ b/core/modules/migrate/src/Plugin/MigrateDestinationInterface.php @@ -8,7 +8,7 @@ namespace Drupal\migrate\Plugin; use Drupal\Component\Plugin\PluginInspectionInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Row; /** diff --git a/core/modules/migrate/src/Plugin/MigrateDestinationPluginManager.php b/core/modules/migrate/src/Plugin/MigrateDestinationPluginManager.php index 96f7be5..d5326e5 100644 --- a/core/modules/migrate/src/Plugin/MigrateDestinationPluginManager.php +++ b/core/modules/migrate/src/Plugin/MigrateDestinationPluginManager.php @@ -11,7 +11,7 @@ use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; /** * Plugin manager for migrate destination plugins. diff --git a/core/modules/migrate/src/Plugin/MigrateIdMapInterface.php b/core/modules/migrate/src/Plugin/MigrateIdMapInterface.php index 36be2dd..06827c4 100644 --- a/core/modules/migrate/src/Plugin/MigrateIdMapInterface.php +++ b/core/modules/migrate/src/Plugin/MigrateIdMapInterface.php @@ -8,7 +8,7 @@ namespace Drupal\migrate\Plugin; use Drupal\Component\Plugin\PluginInspectionInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\MigrateMessageInterface; use Drupal\migrate\Row; diff --git a/core/modules/migrate/src/Plugin/MigratePluginManager.php b/core/modules/migrate/src/Plugin/MigratePluginManager.php index 84f2278..7ff3d60 100644 --- a/core/modules/migrate/src/Plugin/MigratePluginManager.php +++ b/core/modules/migrate/src/Plugin/MigratePluginManager.php @@ -11,7 +11,7 @@ use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Plugin\DefaultPluginManager; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; /** * Manages migrate plugins. diff --git a/core/modules/migrate/src/Plugin/Migration.php b/core/modules/migrate/src/Plugin/Migration.php new file mode 100644 index 0000000..cc63399 --- /dev/null +++ b/core/modules/migrate/src/Plugin/Migration.php @@ -0,0 +1,587 @@ + array( + * // An array of migration IDs that must be run before this migration. + * ), + * 'optional' => array( + * // An array of migration IDs that, if they exist, must be run before + * // this migration. + * ), + * ); + * @endcode + * + * @var array + */ + protected $migration_dependencies = []; + + /** + * The migration's configuration dependencies. + * + * These store any dependencies on modules or other configuration (including + * other migrations) that must be available before the migration can be + * created. + * + * @see \Drupal\Core\Config\Entity\ConfigDependencyManager + * + * @var array + */ + protected $dependencies = []; + + /** + * The ID of the template from which this migration was derived, if any. + * + * @var string|NULL + */ + protected $template; + + /** + * The entity manager. + * + * @var \Drupal\Core\Entity\EntityManagerInterface + */ + protected $entityManager; + + /** + * Labels corresponding to each defined status. + * + * @var array + */ + protected $statusLabels = [ + self::STATUS_IDLE => 'Idle', + self::STATUS_IMPORTING => 'Importing', + self::STATUS_ROLLING_BACK => 'Rolling back', + self::STATUS_STOPPING => 'Stopping', + self::STATUS_DISABLED => 'Disabled', + ]; + + public function __construct(array $configuration, $plugin_id, array $plugin_definition) { + parent::__construct($configuration, $plugin_id, $plugin_definition); + foreach ($plugin_definition as $key => $value) { + $this->$key = $value; + } + } + + public function id() { + return $this->pluginId; + } + + public function get($key) { + return isset($this->pluginDefinition[$key]) ? $this->pluginDefinition[$key] : NULL; + } + + public function getIdMapPlugin() { + return $this->idMapPlugin; + } + + /** + * {@inheritdoc} + */ + public function getSourcePlugin() { + if (!isset($this->sourcePlugin)) { + $this->sourcePlugin = \Drupal::service('plugin.manager.migrate.source')->createInstance($this->source['plugin'], $this->source, $this); + } + return $this->sourcePlugin; + } + + /** + * {@inheritdoc} + */ + public function getProcessPlugins(array $process = NULL) { + if (!isset($process)) { + $process = $this->process; + } + $index = serialize($process); + if (!isset($this->processPlugins[$index])) { + $this->processPlugins[$index] = array(); + foreach ($this->getProcessNormalized($process) as $property => $configurations) { + $this->processPlugins[$index][$property] = array(); + foreach ($configurations as $configuration) { + if (isset($configuration['source'])) { + $this->processPlugins[$index][$property][] = \Drupal::service('plugin.manager.migrate.process')->createInstance('get', $configuration, $this); + } + // Get is already handled. + if ($configuration['plugin'] != 'get') { + $this->processPlugins[$index][$property][] = \Drupal::service('plugin.manager.migrate.process')->createInstance($configuration['plugin'], $configuration, $this); + } + if (!$this->processPlugins[$index][$property]) { + throw new MigrateException("Invalid process configuration for $property"); + } + } + } + } + return $this->processPlugins[$index]; + } + + /** + * Resolve shorthands into a list of plugin configurations. + * + * @param array $process + * A process configuration array. + * + * @return array + * The normalized process configuration. + */ + protected function getProcessNormalized(array $process) { + $normalized_configurations = array(); + foreach ($process as $destination => $configuration) { + if (is_string($configuration)) { + $configuration = array( + 'plugin' => 'get', + 'source' => $configuration, + ); + } + if (isset($configuration['plugin'])) { + $configuration = array($configuration); + } + $normalized_configurations[$destination] = $configuration; + } + return $normalized_configurations; + } + + /** + * {@inheritdoc} + */ + public function getDestinationPlugin($stub_being_requested = FALSE) { + if (!isset($this->destinationPlugin)) { + if ($stub_being_requested && !empty($this->destination['no_stub'])) { + throw new MigrateSkipRowException; + } + $this->destinationPlugin = \Drupal::service('plugin.manager.migrate.destination')->createInstance($this->destination['plugin'], $this->destination, $this); + } + return $this->destinationPlugin; + } + + /** + * {@inheritdoc} + */ + public function getIdMap() { + if (!isset($this->idMapPlugin)) { + $configuration = $this->idMap; + $plugin = isset($configuration['plugin']) ? $configuration['plugin'] : 'sql'; + $this->idMapPlugin = \Drupal::service('plugin.manager.migrate.id_map')->createInstance($plugin, $configuration, $this); + } + return $this->idMapPlugin; + } + + /** + * Get the high water storage object. + * + * @return \Drupal\Core\KeyValueStore\KeyValueStoreInterface + * The storage object. + */ + protected function getHighWaterStorage() { + if (!isset($this->highWaterStorage)) { + $this->highWaterStorage = \Drupal::keyValue('migrate:high_water'); + } + return $this->highWaterStorage; + } + + /** + * {@inheritdoc} + */ + public function getHighWater() { + return $this->getHighWaterStorage()->get($this->id()); + } + + /** + * {@inheritdoc} + */ + public function saveHighWater($high_water) { + $this->getHighWaterStorage()->set($this->id(), $high_water); + } + + /** + * {@inheritdoc} + */ + public function checkRequirements() { + // Check whether the current migration source and destination plugin + // requirements are met or not. + if ($this->getSourcePlugin() instanceof RequirementsInterface) { + $this->getSourcePlugin()->checkRequirements(); + } + if ($this->getDestinationPlugin() instanceof RequirementsInterface) { + $this->getDestinationPlugin()->checkRequirements(); + } + + /** @var \Drupal\migrate\MigrationInterface[] $required_migrations */ + $required_migrations = $this->getEntityManager()->getStorage('migration')->loadMultiple($this->requirements); + + $missing_migrations = array_diff($this->requirements, array_keys($required_migrations)); + // Check if the dependencies are in good shape. + foreach ($required_migrations as $migration_id => $required_migration) { + if (!$required_migration->allRowsProcessed()) { + $missing_migrations[] = $migration_id; + } + } + if ($missing_migrations) { + throw new RequirementsException('Missing migrations ' . implode(', ', $missing_migrations) . '.', ['requirements' => $missing_migrations]); + } + } + + /** + * Get the entity manager. + * + * @return \Drupal\Core\Entity\EntityManagerInterface + * The entity manager. + */ + protected function getEntityManager() { + if (!isset($this->entityManager)) { + $this->entityManager = \Drupal::entityManager(); + } + return $this->entityManager; + } + + /** + * {@inheritdoc} + */ + public function setStatus($status) { + \Drupal::keyValue('migrate_status')->set($this->id(), $status); + } + + /** + * {@inheritdoc} + */ + public function getStatus() { + return \Drupal::keyValue('migrate_status')->get($this->id(), static::STATUS_IDLE); + } + + /** + * {@inheritdoc} + */ + public function getStatusLabel() { + $status = $this->getStatus(); + if (isset($this->statusLabels[$status])) { + return $this->statusLabels[$status]; + } + else { + return ''; + } + } + + /** + * {@inheritdoc} + */ + public function getInterruptionResult() { + return \Drupal::keyValue('migrate_interruption_result')->get($this->id(), static::RESULT_INCOMPLETE); + } + + /** + * {@inheritdoc} + */ + public function clearInterruptionResult() { + \Drupal::keyValue('migrate_interruption_result')->delete($this->id()); + } + + /** + * {@inheritdoc} + */ + public function interruptMigration($result) { + $this->setStatus(MigrationInterface::STATUS_STOPPING); + \Drupal::keyValue('migrate_interruption_result')->set($this->id(), $result); + } + + /** + * {@inheritdoc} + */ + public function allRowsProcessed() { + $source_count = $this->getSourcePlugin()->count(); + // If the source is uncountable, we have no way of knowing if it's + // complete, so stipulate that it is. + if ($source_count < 0) { + return TRUE; + } + $processed_count = $this->getIdMap()->processedCount(); + // We don't use == because in some circumstances (like unresolved stubs + // being created), the processed count may be higher than the available + // source rows. + return $source_count <= $processed_count; + } + + /** + * {@inheritdoc} + */ + public function set($property_name, $value) { + if ($property_name == 'source') { + // Invalidate the source plugin. + unset($this->sourcePlugin); + } + elseif ($property_name === 'destination') { + // Invalidate the destination plugin. + unset($this->destinationPlugin); + } + return parent::set($property_name, $value); + } + + + /** + * {@inheritdoc} + */ + public function getProcess() { + return $this->getProcessNormalized($this->process); + } + + /** + * {@inheritdoc} + */ + public function setProcess(array $process) { + $this->process = $process; + return $this; + } + + /** + * {@inheritdoc} + */ + public function setProcessOfProperty($property, $process_of_property) { + $this->process[$property] = $process_of_property; + return $this; + } + + /** + * {@inheritdoc} + */ + public function mergeProcessOfProperty($property, array $process_of_property) { + // If we already have a process value then merge the incoming process array + //otherwise simply set it. + $current_process = $this->getProcess(); + if (isset($current_process[$property])) { + $this->process = NestedArray::mergeDeepArray([$current_process, $this->getProcessNormalized([$property => $process_of_property])], TRUE); + } + else { + $this->setProcessOfProperty($property, $process_of_property); + } + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getSystemOfRecord() { + return $this->systemOfRecord; + } + + /** + * {@inheritdoc} + */ + public function setSystemOfRecord($system_of_record) { + $this->systemOfRecord = $system_of_record; + return $this; + } + + /** + * {@inheritdoc} + */ + public function isTrackLastImported() { + return $this->trackLastImported; + } + + /** + * {@inheritdoc} + */ + public function setTrackLastImported($track_last_imported) { + $this->trackLastImported = (bool) $track_last_imported; + return $this; + } + + /** + * {@inheritdoc} + */ + public function getMigrationDependencies() { + return $this->migration_dependencies + ['required' => [], 'optional' => []]; + } + + /** + * {@inheritdoc} + */ + public function trustData() { + // Migrations cannot be trusted since they are often written by hand and not + // through a UI. + $this->trustedData = FALSE; + return $this; + } + +} diff --git a/core/modules/migrate/src/Plugin/MigrationPluginManager.php b/core/modules/migrate/src/Plugin/MigrationPluginManager.php new file mode 100644 index 0000000..caf939d --- /dev/null +++ b/core/modules/migrate/src/Plugin/MigrationPluginManager.php @@ -0,0 +1,57 @@ + '\Drupal\migrate\Plugin\Migration', + ); + + /** + * @var \Drupal\Core\Extension\ModuleHandlerInterface + */ + protected $moduleHandler; + + public function __construct(ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend, LanguageManagerInterface $language_manager) { + $this->factory = new ContainerFactory($this /* '\Drupal\migrate\Plugin\MigrationInterface'*/); + $this->alterInfo('migration_plugins'); + $this->setCacheBackend($cache_backend, 'migration_plugins:' . $language_manager->getCurrentLanguage()->getId(), array('migration_plugins')); + $this->moduleHandler = $module_handler; + } + + /** + * Gets the plugin discovery. + * + * @return \Drupal\Component\Plugin\Discovery\DiscoveryInterface + */ + protected function getDiscovery() { + if (!isset($this->discovery)) { + $yaml_discovery = new MigrationTemplateDiscovery($this->moduleHandler->getModuleDirectories()); + $yaml_discovery->addTranslatableProperty('label', 'title_context'); + $this->discovery = new ContainerDerivativeDiscoveryDecorator($yaml_discovery); + } + return $this->discovery; + } + +} diff --git a/core/modules/migrate/src/Plugin/MigrationTemplateDiscovery.php b/core/modules/migrate/src/Plugin/MigrationTemplateDiscovery.php new file mode 100644 index 0000000..5fea87c --- /dev/null +++ b/core/modules/migrate/src/Plugin/MigrationTemplateDiscovery.php @@ -0,0 +1,20 @@ +discovery = new MigrationYamlDiscovery($directories); + } + +} diff --git a/core/modules/migrate/src/Plugin/MigrationYamlDiscovery.php b/core/modules/migrate/src/Plugin/MigrationYamlDiscovery.php new file mode 100644 index 0000000..30cf35f --- /dev/null +++ b/core/modules/migrate/src/Plugin/MigrationYamlDiscovery.php @@ -0,0 +1,79 @@ +directories = $directories; + } + + /** + * {@inheritdoc} + */ + public function findAll() { + $all = []; + + $provider_by_files = $this->findFiles(); + + $file_cache = FileCacheFactory::get('yaml_discovery:migration'); + + // Try to load from the file cache first. + foreach ($file_cache->getMultiple(array_keys($provider_by_files)) as $file => $data) { + $all[$provider_by_files[$file]][$data['id']] = $data; + unset($provider_by_files[$file]); + } + + // If there are files left that were not returned from the cache, load and + // parse them now. + if ($provider_by_files) { + foreach ($provider_by_files as $file => $provider) { + // If a file is empty or its contents are commented out, return an empty + // array instead of NULL for type consistency. + $contents = Yaml::decode(file_get_contents($file)) ?: []; + if (!isset($contents['id'])) { + list($contents['id']) = explode('.', basename($file), 2); + } + $all[$provider][$contents['id']] = $contents; + $file_cache->set($file, $contents); + } + } + + return $all; + } + + /** + * Finds the migration files. + * + * @return array + * Keys are the filenames, values are the provider. + */ + protected function findFiles() { + $files = []; + foreach ($this->directories as $provider => $directory) { + $directory .= '/migration_templates'; + if (is_dir($directory)) { + foreach (glob("$directory/*.yml") as $filename) { + $files[$filename] = $provider; + } + } + } + return $files; + } + +} diff --git a/core/modules/migrate/src/Plugin/migrate/destination/ComponentEntityDisplayBase.php b/core/modules/migrate/src/Plugin/migrate/destination/ComponentEntityDisplayBase.php index dfd1739..f34d048 100644 --- a/core/modules/migrate/src/Plugin/migrate/destination/ComponentEntityDisplayBase.php +++ b/core/modules/migrate/src/Plugin/migrate/destination/ComponentEntityDisplayBase.php @@ -7,7 +7,7 @@ namespace Drupal\migrate\Plugin\migrate\destination; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Row; /** diff --git a/core/modules/migrate/src/Plugin/migrate/destination/Config.php b/core/modules/migrate/src/Plugin/migrate/destination/Config.php index 0dd9fd3..b975134 100644 --- a/core/modules/migrate/src/Plugin/migrate/destination/Config.php +++ b/core/modules/migrate/src/Plugin/migrate/destination/Config.php @@ -11,7 +11,7 @@ use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\DependencyTrait; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Row; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -47,7 +47,7 @@ class Config extends DestinationBase implements ContainerFactoryPluginInterface, * The plugin ID for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. - * @param \Drupal\migrate\Entity\MigrationInterface $migration + * @param \Drupal\migrate\MigrationInterface $migration * The migration entity. * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory * The configuration factory. diff --git a/core/modules/migrate/src/Plugin/migrate/destination/DestinationBase.php b/core/modules/migrate/src/Plugin/migrate/destination/DestinationBase.php index 0a38ba8..fa5e9b3 100644 --- a/core/modules/migrate/src/Plugin/migrate/destination/DestinationBase.php +++ b/core/modules/migrate/src/Plugin/migrate/destination/DestinationBase.php @@ -8,7 +8,7 @@ namespace Drupal\migrate\Plugin\migrate\destination; use Drupal\Core\Plugin\PluginBase; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Exception\RequirementsException; use Drupal\migrate\Plugin\MigrateDestinationInterface; use Drupal\migrate\Plugin\MigrateIdMapInterface; @@ -43,7 +43,7 @@ /** * The migration. * - * @var \Drupal\migrate\Entity\MigrationInterface + * @var \Drupal\migrate\MigrationInterface */ protected $migration; diff --git a/core/modules/migrate/src/Plugin/migrate/destination/Entity.php b/core/modules/migrate/src/Plugin/migrate/destination/Entity.php index c8cca65..93a6db7 100644 --- a/core/modules/migrate/src/Plugin/migrate/destination/Entity.php +++ b/core/modules/migrate/src/Plugin/migrate/destination/Entity.php @@ -11,7 +11,7 @@ use Drupal\Core\Entity\DependencyTrait; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Row; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php b/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php index f23b54f..a167bb0 100644 --- a/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php +++ b/core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php @@ -13,7 +13,7 @@ use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Field\FieldTypePluginManagerInterface; use Drupal\Core\TypedData\TypedDataInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\MigrateException; use Drupal\migrate\Plugin\MigrateIdMapInterface; use Drupal\migrate\Row; @@ -47,7 +47,7 @@ class EntityContentBase extends Entity { * The plugin ID for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. - * @param \Drupal\migrate\Entity\MigrationInterface $migration + * @param \Drupal\migrate\MigrationInterface $migration * The migration entity. * @param \Drupal\Core\Entity\EntityStorageInterface $storage * The storage for this entity type. diff --git a/core/modules/migrate/src/Plugin/migrate/destination/NullDestination.php b/core/modules/migrate/src/Plugin/migrate/destination/NullDestination.php index f35c5d4..f0e3004 100644 --- a/core/modules/migrate/src/Plugin/migrate/destination/NullDestination.php +++ b/core/modules/migrate/src/Plugin/migrate/destination/NullDestination.php @@ -7,7 +7,7 @@ namespace Drupal\migrate\Plugin\migrate\destination; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Row; /** diff --git a/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php index 9005ef2..ebfda6a 100644 --- a/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php +++ b/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php @@ -11,7 +11,7 @@ use Drupal\Core\Field\BaseFieldDefinition; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Plugin\PluginBase; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Event\MigrateIdMapMessageEvent; use Drupal\migrate\MigrateException; use Drupal\migrate\MigrateMessageInterface; @@ -78,7 +78,7 @@ class Sql extends PluginBase implements MigrateIdMapInterface, ContainerFactoryP /** * The migration being done. * - * @var \Drupal\migrate\Entity\MigrationInterface + * @var \Drupal\migrate\MigrationInterface */ protected $migration; @@ -149,7 +149,7 @@ class Sql extends PluginBase implements MigrateIdMapInterface, ContainerFactoryP * The plugin ID for the migration process to do. * @param mixed $plugin_definition * The configuration for the plugin. - * @param \Drupal\migrate\Entity\MigrationInterface $migration + * @param \Drupal\migrate\MigrationInterface $migration * The migration to do. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EventDispatcherInterface $event_dispatcher) { diff --git a/core/modules/migrate/src/Plugin/migrate/process/DedupeEntity.php b/core/modules/migrate/src/Plugin/migrate/process/DedupeEntity.php index 58bcdf8..450f358 100644 --- a/core/modules/migrate/src/Plugin/migrate/process/DedupeEntity.php +++ b/core/modules/migrate/src/Plugin/migrate/process/DedupeEntity.php @@ -9,7 +9,7 @@ use Drupal\Core\Entity\Query\QueryFactory; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/core/modules/migrate/src/Plugin/migrate/process/Migration.php b/core/modules/migrate/src/Plugin/migrate/process/Migration.php index 233ad1e..ae5948e 100644 --- a/core/modules/migrate/src/Plugin/migrate/process/Migration.php +++ b/core/modules/migrate/src/Plugin/migrate/process/Migration.php @@ -13,7 +13,7 @@ use Drupal\migrate\MigrateSkipProcessException; use Drupal\migrate\Plugin\MigratePluginManager; use Drupal\migrate\ProcessPluginBase; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\MigrateExecutableInterface; use Drupal\migrate\Row; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -76,7 +76,7 @@ public function transform($value, MigrateExecutableInterface $migrate_executable } $this->skipOnEmpty($value); $self = FALSE; - /** @var \Drupal\migrate\Entity\MigrationInterface[] $migrations */ + /** @var \Drupal\migrate\MigrationInterface[] $migrations */ $migrations = $this->migrationStorage->loadMultiple($migration_ids); $destination_ids = NULL; $source_id_values = array(); diff --git a/core/modules/migrate/src/Plugin/migrate/process/Route.php b/core/modules/migrate/src/Plugin/migrate/process/Route.php index 7b83f21..0ec1481 100644 --- a/core/modules/migrate/src/Plugin/migrate/process/Route.php +++ b/core/modules/migrate/src/Plugin/migrate/process/Route.php @@ -8,7 +8,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\Core\Path\PathValidatorInterface; use Drupal\migrate\MigrateExecutableInterface; use Drupal\migrate\ProcessPluginBase; diff --git a/core/modules/migrate/src/Plugin/migrate/source/EmbeddedDataSource.php b/core/modules/migrate/src/Plugin/migrate/source/EmbeddedDataSource.php index 4b429eb..0b48bd8 100644 --- a/core/modules/migrate/src/Plugin/migrate/source/EmbeddedDataSource.php +++ b/core/modules/migrate/src/Plugin/migrate/source/EmbeddedDataSource.php @@ -6,7 +6,7 @@ */ namespace Drupal\migrate\Plugin\migrate\source; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; /** * Source which takes its data directly from the plugin config. diff --git a/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php b/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php index a222eee..17a2e01 100644 --- a/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php +++ b/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php @@ -8,7 +8,7 @@ namespace Drupal\migrate\Plugin\migrate\source; use Drupal\Core\Plugin\PluginBase; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\MigrateException; use Drupal\migrate\MigrateSkipRowException; use Drupal\migrate\Plugin\MigrateIdMapInterface; @@ -33,7 +33,7 @@ protected $moduleHandler; /** - * @var \Drupal\migrate\Entity\MigrationInterface + * @var \Drupal\migrate\MigrationInterface */ protected $migration; diff --git a/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php b/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php index 343e723..796fd63 100644 --- a/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php +++ b/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php @@ -10,7 +10,7 @@ use Drupal\Core\Database\Database; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\State\StateInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Plugin\migrate\id_map\Sql; use Drupal\migrate\Plugin\MigrateIdMapInterface; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/core/modules/migrate/src/Tests/MigrateEventsTest.php b/core/modules/migrate/src/Tests/MigrateEventsTest.php index ae540ac..2322300 100644 --- a/core/modules/migrate/src/Tests/MigrateEventsTest.php +++ b/core/modules/migrate/src/Tests/MigrateEventsTest.php @@ -14,7 +14,6 @@ use Drupal\migrate\Event\MigratePostRowSaveEvent; use Drupal\migrate\Event\MigratePreRowSaveEvent; use Drupal\migrate\MigrateMessage; -use Drupal\migrate\Entity\MigrationInterface; use Drupal\migrate\Event\MigrateEvents; use Drupal\migrate\MigrateExecutable; use Drupal\simpletest\KernelTestBase; @@ -84,7 +83,6 @@ public function testMigrateEvents() { $migration = Migration::create($config); - /** @var MigrationInterface $migration */ $executable = new MigrateExecutable($migration, new MigrateMessage()); // As the import runs, events will be dispatched, recording the received // information in state. diff --git a/core/modules/migrate/src/Tests/MigrateInterruptionTest.php b/core/modules/migrate/src/Tests/MigrateInterruptionTest.php index a7abd86..bb017b1 100644 --- a/core/modules/migrate/src/Tests/MigrateInterruptionTest.php +++ b/core/modules/migrate/src/Tests/MigrateInterruptionTest.php @@ -10,7 +10,7 @@ use Drupal\migrate\Entity\Migration; use Drupal\migrate\Event\MigratePostRowSaveEvent; use Drupal\migrate\MigrateMessage; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Event\MigrateEvents; use Drupal\migrate\MigrateExecutable; use Drupal\simpletest\KernelTestBase; @@ -63,7 +63,6 @@ public function testMigrateEvents() { $migration = Migration::create($config); - /** @var MigrationInterface $migration */ $executable = new MigrateExecutable($migration, new MigrateMessage()); // When the import runs, the first row imported will trigger an // interruption. diff --git a/core/modules/migrate/src/Tests/MigrateMessageTest.php b/core/modules/migrate/src/Tests/MigrateMessageTest.php index dcf2a8b..b4c904f 100644 --- a/core/modules/migrate/src/Tests/MigrateMessageTest.php +++ b/core/modules/migrate/src/Tests/MigrateMessageTest.php @@ -8,7 +8,7 @@ namespace Drupal\migrate\Tests; use Drupal\migrate\Entity\Migration; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Event\MigrateEvents; use Drupal\migrate\Event\MigrateIdMapMessageEvent; use Drupal\migrate\MigrateExecutable; @@ -32,7 +32,7 @@ class MigrateMessageTest extends KernelTestBase implements MigrateMessageInterfa /** * Migration to run. * - * @var \Drupal\migrate\Entity\MigrationInterface + * @var \Drupal\migrate\MigrationInterface */ protected $migration; diff --git a/core/modules/migrate/src/Tests/MigrateSkipRowTest.php b/core/modules/migrate/src/Tests/MigrateSkipRowTest.php index 93c1a7c..a332966 100644 --- a/core/modules/migrate/src/Tests/MigrateSkipRowTest.php +++ b/core/modules/migrate/src/Tests/MigrateSkipRowTest.php @@ -9,7 +9,7 @@ use Drupal\migrate\Entity\Migration; use Drupal\migrate\MigrateMessage; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\MigrateExecutable; use Drupal\migrate\Plugin\MigrateIdMapInterface; use Drupal\simpletest\KernelTestBase; diff --git a/core/modules/migrate/src/Tests/MigrateStatusTest.php b/core/modules/migrate/src/Tests/MigrateStatusTest.php index bdfcf74..45332eb 100644 --- a/core/modules/migrate/src/Tests/MigrateStatusTest.php +++ b/core/modules/migrate/src/Tests/MigrateStatusTest.php @@ -8,7 +8,7 @@ namespace Drupal\migrate\Tests; use Drupal\migrate\Entity\Migration; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; /** * Tests migration status tracking. diff --git a/core/modules/migrate/src/Tests/MigrateTestBase.php b/core/modules/migrate/src/Tests/MigrateTestBase.php index e9012e3..58d6243 100644 --- a/core/modules/migrate/src/Tests/MigrateTestBase.php +++ b/core/modules/migrate/src/Tests/MigrateTestBase.php @@ -7,6 +7,7 @@ namespace Drupal\migrate\Tests; +use Drupal\Component\Plugin\Exception\PluginException; use Drupal\Core\Database\Database; use Drupal\migrate\Entity\Migration; use Drupal\migrate\MigrateExecutable; @@ -40,7 +41,7 @@ /** * The primary migration being tested. * - * @var \Drupal\migrate\Entity\MigrationInterface + * @var \Drupal\migrate\MigrationInterface */ protected $migration; @@ -130,7 +131,8 @@ private function cleanupMigrateConnection() { protected function prepareMigrations(array $id_mappings) { foreach ($id_mappings as $migration_id => $data) { // Use loadMultiple() here in order to load all variants. - foreach (Migration::loadMultiple([$migration_id]) as $migration) { + try { + $migration = $this->container->get('plugin.manager.migration')->createInstance($migration_id); $id_map = $migration->getIdMap(); $id_map->setMessage($this); $source_ids = $migration->getSourcePlugin()->getIds(); @@ -139,18 +141,21 @@ protected function prepareMigrations(array $id_mappings) { $id_map->saveIdMapping($row, $id_mapping[1]); } } + catch (PluginException $e) { + + } } } /** * Executes a single migration. * - * @param string|\Drupal\migrate\Entity\MigrationInterface $migration + * @param string|\Drupal\migrate\MigrationInterface $migration * The migration to execute, or its ID. */ protected function executeMigration($migration) { if (is_string($migration)) { - $this->migration = Migration::load($migration); + $this->migration = $this->container->get('plugin.manager.migration')->createInstance($migration); } else { $this->migration = $migration; @@ -204,7 +209,7 @@ public function stopCollectingMessages() { * * This is done in order to test scenarios which require a failed row. * - * @param string|\Drupal\migrate\Entity\MigrationInterface $migration + * @param string|\Drupal\migrate\MigrationInterface $migration * The migration entity, or its ID. * @param array $row * The raw source row which "failed". @@ -217,7 +222,7 @@ protected function mockFailure($migration, array $row, $status = MigrateIdMapInt if (is_string($migration)) { $migration = Migration::load($migration); } - /** @var \Drupal\migrate\Entity\MigrationInterface $migration */ + /** @var \Drupal\migrate\MigrationInterface $migration */ $destination = array_map(function() { return NULL; }, $migration->getDestinationPlugin()->getIds()); $row = new Row($row, $migration->getSourcePlugin()->getIds()); $migration->getIdMap()->saveIdMapping($row, $destination, $status); diff --git a/core/modules/migrate/tests/modules/migrate_events_test/src/Plugin/migrate/destination/DummyDestination.php b/core/modules/migrate/tests/modules/migrate_events_test/src/Plugin/migrate/destination/DummyDestination.php index 984560b..58dc9bd 100644 --- a/core/modules/migrate/tests/modules/migrate_events_test/src/Plugin/migrate/destination/DummyDestination.php +++ b/core/modules/migrate/tests/modules/migrate_events_test/src/Plugin/migrate/destination/DummyDestination.php @@ -7,7 +7,7 @@ namespace Drupal\migrate_events_test\Plugin\migrate\destination; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Plugin\migrate\destination\DestinationBase; use Drupal\migrate\Row; diff --git a/core/modules/migrate/tests/modules/migrate_prepare_row_test/migrate_prepare_row_test.module b/core/modules/migrate/tests/modules/migrate_prepare_row_test/migrate_prepare_row_test.module index 9d9bd02..7e98dca 100644 --- a/core/modules/migrate/tests/modules/migrate_prepare_row_test/migrate_prepare_row_test.module +++ b/core/modules/migrate/tests/modules/migrate_prepare_row_test/migrate_prepare_row_test.module @@ -6,7 +6,7 @@ * handling. */ -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\MigrateSkipRowException; use Drupal\migrate\Plugin\MigrateSourceInterface; use Drupal\migrate\Row; diff --git a/core/modules/migrate/tests/src/Unit/MigrateExecutableMemoryExceededTest.php b/core/modules/migrate/tests/src/Unit/MigrateExecutableMemoryExceededTest.php index 477e890..addc14f 100644 --- a/core/modules/migrate/tests/src/Unit/MigrateExecutableMemoryExceededTest.php +++ b/core/modules/migrate/tests/src/Unit/MigrateExecutableMemoryExceededTest.php @@ -17,7 +17,7 @@ class MigrateExecutableMemoryExceededTest extends MigrateTestCase { /** * The mocked migration entity. * - * @var \Drupal\migrate\Entity\MigrationInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\migrate\MigrationInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $migration; diff --git a/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php b/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php index 1502421..7589a4a 100644 --- a/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php +++ b/core/modules/migrate/tests/src/Unit/MigrateExecutableTest.php @@ -8,7 +8,7 @@ namespace Drupal\Tests\migrate\Unit; use Drupal\Component\Utility\Html; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Plugin\MigrateIdMapInterface; use Drupal\migrate\MigrateException; use Drupal\migrate\Row; @@ -22,7 +22,7 @@ class MigrateExecutableTest extends MigrateTestCase { /** * The mocked migration entity. * - * @var \Drupal\migrate\Entity\MigrationInterface|\PHPUnit_Framework_MockObject_MockObject + * @var \Drupal\migrate\MigrationInterface|\PHPUnit_Framework_MockObject_MockObject */ protected $migration; diff --git a/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php b/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php index 502c9e7..2571c0a 100644 --- a/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php +++ b/core/modules/migrate/tests/src/Unit/MigrateSourceTest.php @@ -369,7 +369,7 @@ public function testPrepareRowPrepareException() { /** * Get a mock executable for the test. * - * @param \Drupal\migrate\Entity\MigrationInterface $migration + * @param \Drupal\migrate\MigrationInterface $migration * The migration entity. * * @return \Drupal\migrate\MigrateExecutable diff --git a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php index bca8908..bcff401 100644 --- a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php +++ b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php @@ -8,7 +8,7 @@ namespace Drupal\Tests\migrate\Unit; use Drupal\Core\Database\Driver\sqlite\Connection; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\MigrateException; use Drupal\migrate\Plugin\MigrateIdMapInterface; use Drupal\migrate\Row; diff --git a/core/modules/migrate/tests/src/Unit/MigrateTestCase.php b/core/modules/migrate/tests/src/Unit/MigrateTestCase.php index e3a253a..aa05df1 100644 --- a/core/modules/migrate/tests/src/Unit/MigrateTestCase.php +++ b/core/modules/migrate/tests/src/Unit/MigrateTestCase.php @@ -9,7 +9,7 @@ use Drupal\Core\Database\Driver\sqlite\Connection; use Drupal\Core\DependencyInjection\ContainerBuilder; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\Tests\UnitTestCase; /** @@ -27,14 +27,14 @@ /** * Local store for mocking setStatus()/getStatus(). * - * @var \Drupal\migrate\Entity\MigrationInterface::STATUS_* + * @var \Drupal\migrate\MigrationInterface::STATUS_* */ protected $migrationStatus = MigrationInterface::STATUS_IDLE; /** * Retrieve a mocked migration. * - * @return \Drupal\migrate\Entity\MigrationInterface|\PHPUnit_Framework_MockObject_MockObject + * @return \Drupal\migrate\MigrationInterface|\PHPUnit_Framework_MockObject_MockObject * The mocked migration. */ protected function getMigration() { diff --git a/core/modules/migrate/tests/src/Unit/MigrationTest.php b/core/modules/migrate/tests/src/Unit/MigrationTest.php index 87f6c43..e6fd300 100644 --- a/core/modules/migrate/tests/src/Unit/MigrationTest.php +++ b/core/modules/migrate/tests/src/Unit/MigrationTest.php @@ -91,9 +91,9 @@ public function testRequirementsForMigrations() { // completed yet. $migration->setRequirements(['test_a', 'test_b', 'test_c', 'test_d']); - $migration_b = $this->getMock('Drupal\migrate\Entity\MigrationInterface'); - $migration_c = $this->getMock('Drupal\migrate\Entity\MigrationInterface'); - $migration_d = $this->getMock('Drupal\migrate\Entity\MigrationInterface'); + $migration_b = $this->getMock('Drupal\migrate\MigrationInterface'); + $migration_c = $this->getMock('Drupal\migrate\MigrationInterface'); + $migration_d = $this->getMock('Drupal\migrate\MigrationInterface'); $migration_b->expects($this->once()) ->method('allRowsProcessed') diff --git a/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php b/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php index 220cbe8..2f20b75 100644 --- a/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php +++ b/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php @@ -11,7 +11,7 @@ use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Field\FieldTypePluginManagerInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Plugin\migrate\destination\EntityContentBase; use Drupal\migrate\Plugin\MigrateIdMapInterface; use Drupal\migrate\Row; @@ -26,7 +26,7 @@ class EntityContentBaseTest extends UnitTestCase { /** - * @var \Drupal\migrate\Entity\MigrationInterface + * @var \Drupal\migrate\MigrationInterface */ protected $migration; diff --git a/core/modules/migrate/tests/src/Unit/SqlBaseTest.php b/core/modules/migrate/tests/src/Unit/SqlBaseTest.php index 62a0698..4ef9f9e 100644 --- a/core/modules/migrate/tests/src/Unit/SqlBaseTest.php +++ b/core/modules/migrate/tests/src/Unit/SqlBaseTest.php @@ -59,7 +59,7 @@ public function testMapJoinable($expected_result, $id_map_is_sql, $with_id_map, ->willReturn($idmap_connection); // Setup a migration entity. - $migration = $this->getMock('Drupal\migrate\Entity\MigrationInterface'); + $migration = $this->getMock('Drupal\migrate\MigrationInterface'); $migration->expects($with_id_map ? $this->once() : $this->never()) ->method('getIdMap') ->willReturn($id_map_is_sql ? $sql : NULL); diff --git a/core/modules/migrate/tests/src/Unit/TestSqlIdMap.php b/core/modules/migrate/tests/src/Unit/TestSqlIdMap.php index fa31689..fc63c0f 100644 --- a/core/modules/migrate/tests/src/Unit/TestSqlIdMap.php +++ b/core/modules/migrate/tests/src/Unit/TestSqlIdMap.php @@ -8,7 +8,7 @@ namespace Drupal\Tests\migrate\Unit; use Drupal\Core\Database\Connection; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\MigrateException; use Drupal\migrate\Plugin\migrate\id_map\Sql; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -29,7 +29,7 @@ class TestSqlIdMap extends Sql implements \Iterator { * The plugin ID for the migration process to do. * @param mixed $plugin_definition * The configuration for the plugin. - * @param \Drupal\migrate\Entity\MigrationInterface $migration + * @param \Drupal\migrate\MigrationInterface $migration * The migration to do. */ public function __construct(Connection $database, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EventDispatcherInterface $event_dispatcher) { diff --git a/core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php b/core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php index 2db5d9e..3c3a91a 100644 --- a/core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php +++ b/core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php @@ -22,7 +22,7 @@ class EntityRevisionTest extends UnitTestCase { /** - * @var \Drupal\migrate\Entity\MigrationInterface + * @var \Drupal\migrate\MigrationInterface */ protected $migration; diff --git a/core/modules/migrate_drupal/src/Plugin/MigrateCckFieldInterface.php b/core/modules/migrate_drupal/src/Plugin/MigrateCckFieldInterface.php index dbe499d..11332ef 100644 --- a/core/modules/migrate_drupal/src/Plugin/MigrateCckFieldInterface.php +++ b/core/modules/migrate_drupal/src/Plugin/MigrateCckFieldInterface.php @@ -8,7 +8,7 @@ namespace Drupal\migrate_drupal\Plugin; use Drupal\Component\Plugin\PluginInspectionInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Row; /** @@ -19,7 +19,7 @@ /** * Apply any custom processing to the field migration. * - * @param \Drupal\migrate\Entity\MigrationInterface $migration + * @param \Drupal\migrate\MigrationInterface $migration * The migration entity. */ public function processField(MigrationInterface $migration); @@ -27,7 +27,7 @@ public function processField(MigrationInterface $migration); /** * Apply any custom processing to the field instance migration. * - * @param \Drupal\migrate\Entity\MigrationInterface $migration + * @param \Drupal\migrate\MigrationInterface $migration * The migration entity. */ public function processFieldInstance(MigrationInterface $migration); @@ -35,7 +35,7 @@ public function processFieldInstance(MigrationInterface $migration); /** * Apply any custom processing to the field widget migration. * - * @param \Drupal\migrate\Entity\MigrationInterface $migration + * @param \Drupal\migrate\MigrationInterface $migration * The migration entity. */ public function processFieldWidget(MigrationInterface $migration); @@ -43,7 +43,7 @@ public function processFieldWidget(MigrationInterface $migration); /** * Apply any custom processing to the field formatter migration. * - * @param \Drupal\migrate\Entity\MigrationInterface $migration + * @param \Drupal\migrate\MigrationInterface $migration * The migration entity. */ public function processFieldFormatter(MigrationInterface $migration); @@ -69,7 +69,7 @@ public function getFieldWidgetMap(); /** * Apply any custom processing to the cck bundle migrations. * - * @param \Drupal\migrate\Entity\MigrationInterface $migration + * @param \Drupal\migrate\MigrationInterface $migration * The migration entity. * @param string $field_name * The field name we're processing the value for. diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/builder/CckBuilder.php b/core/modules/migrate_drupal/src/Plugin/migrate/builder/CckBuilder.php index 50b1fcd..e3f4365 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/builder/CckBuilder.php +++ b/core/modules/migrate_drupal/src/Plugin/migrate/builder/CckBuilder.php @@ -8,7 +8,7 @@ namespace Drupal\migrate_drupal\Plugin\migrate\builder; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Plugin\migrate\builder\BuilderBase; use Drupal\migrate\Plugin\MigratePluginManager; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -66,7 +66,7 @@ public static function create(ContainerInterface $container, array $configuratio * * @param string $field_type * The field type (plugin ID). - * @param \Drupal\migrate\Entity\MigrationInterface|NULL $migration + * @param \Drupal\migrate\MigrationInterface|NULL $migration * The migration, if any. * * @return \Drupal\migrate_drupal\Plugin\MigrateCckFieldInterface diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php b/core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php index 7667c7f..2325e63 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php +++ b/core/modules/migrate_drupal/src/Plugin/migrate/cckfield/CckFieldPluginBase.php @@ -8,7 +8,7 @@ namespace Drupal\migrate_drupal\Plugin\migrate\cckfield; use Drupal\Core\Plugin\PluginBase; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Row; use Drupal\migrate_drupal\Plugin\MigrateCckFieldInterface; diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/destination/EntityFieldStorageConfig.php b/core/modules/migrate_drupal/src/Plugin/migrate/destination/EntityFieldStorageConfig.php index 50b004c..06d42bf 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/destination/EntityFieldStorageConfig.php +++ b/core/modules/migrate_drupal/src/Plugin/migrate/destination/EntityFieldStorageConfig.php @@ -10,7 +10,7 @@ use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Field\FieldTypePluginManagerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Plugin\migrate\destination\EntityFieldStorageConfig as BaseEntityFieldStorageConfig; /** @@ -38,7 +38,7 @@ class EntityFieldStorageConfig extends BaseEntityFieldStorageConfig { * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. - * @param MigrationInterface $migration + * @param \Drupal\migrate\MigrationInterface $migration * The migration. * @param EntityStorageInterface $storage * The storage for this entity type. diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php b/core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php index bb7f452..c8f1070 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php +++ b/core/modules/migrate_drupal/src/Plugin/migrate/source/DrupalSqlBase.php @@ -12,7 +12,7 @@ use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\State\StateInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Exception\RequirementsException; use Drupal\migrate\Plugin\migrate\source\SqlBase; use Drupal\migrate\Plugin\RequirementsInterface; diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/source/EmptySource.php b/core/modules/migrate_drupal/src/Plugin/migrate/source/EmptySource.php index 60a8843..65ebcf6 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/source/EmptySource.php +++ b/core/modules/migrate_drupal/src/Plugin/migrate/source/EmptySource.php @@ -10,7 +10,7 @@ use Drupal\Component\Plugin\DependentPluginInterface; use Drupal\Core\Entity\DependencyTrait; use Symfony\Component\DependencyInjection\ContainerInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Plugin\migrate\source\EmptySource as BaseEmptySource; use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php b/core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php index 4273846..fa8d3e8 100644 --- a/core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php +++ b/core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php @@ -9,7 +9,7 @@ use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\State\StateInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; /** * Drupal variable source from database. diff --git a/core/modules/node/src/Tests/Migrate/d6/MigrateNodeBuilderTest.php b/core/modules/node/src/Tests/Migrate/d6/MigrateNodeBuilderTest.php index 774d344..b0530a9 100644 --- a/core/modules/node/src/Tests/Migrate/d6/MigrateNodeBuilderTest.php +++ b/core/modules/node/src/Tests/Migrate/d6/MigrateNodeBuilderTest.php @@ -7,7 +7,7 @@ namespace Drupal\node\Tests\Migrate\d6; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; use Drupal\migrate\Entity\Migration; diff --git a/core/modules/path/src/Plugin/migrate/destination/UrlAlias.php b/core/modules/path/src/Plugin/migrate/destination/UrlAlias.php index 20b2c31..12184d9 100644 --- a/core/modules/path/src/Plugin/migrate/destination/UrlAlias.php +++ b/core/modules/path/src/Plugin/migrate/destination/UrlAlias.php @@ -8,7 +8,7 @@ namespace Drupal\path\Plugin\migrate\destination; use Drupal\Core\Path\AliasStorage; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Row; use Drupal\migrate\Plugin\migrate\destination\DestinationBase; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -37,7 +37,7 @@ class UrlAlias extends DestinationBase implements ContainerFactoryPluginInterfac * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. - * @param MigrationInterface $migration + * @param \Drupal\migrate\MigrationInterface $migration * The migration. * @param \Drupal\Core\Path\AliasStorage $alias_storage * The alias storage service. diff --git a/core/modules/search/src/Tests/Migrate/d6/MigrateSearchPageTest.php b/core/modules/search/src/Tests/Migrate/d6/MigrateSearchPageTest.php index 8f04775..fee54e4 100644 --- a/core/modules/search/src/Tests/Migrate/d6/MigrateSearchPageTest.php +++ b/core/modules/search/src/Tests/Migrate/d6/MigrateSearchPageTest.php @@ -57,7 +57,7 @@ public function testSearchPage() { ->condition('name', 'node_rank_comments') ->execute(); - /** @var \Drupal\migrate\Entity\MigrationInterface $migration */ + /** @var \Drupal\migrate\MigrationInterface $migration */ $migration = \Drupal::entityManager() ->getStorage('migration') ->loadUnchanged('search_page'); diff --git a/core/modules/search/src/Tests/Migrate/d7/MigrateSearchPageTest.php b/core/modules/search/src/Tests/Migrate/d7/MigrateSearchPageTest.php index 4781dbc..fdce67d 100644 --- a/core/modules/search/src/Tests/Migrate/d7/MigrateSearchPageTest.php +++ b/core/modules/search/src/Tests/Migrate/d7/MigrateSearchPageTest.php @@ -59,7 +59,7 @@ public function testSearchPage() { ->condition('name', 'node_rank_comments') ->execute(); - /** @var \Drupal\migrate\Entity\MigrationInterface $migration */ + /** @var \Drupal\migrate\MigrationInterface $migration */ $migration = \Drupal::entityManager() ->getStorage('migration') ->loadUnchanged('search_page'); diff --git a/core/modules/shortcut/src/Plugin/migrate/destination/ShortcutSetUsers.php b/core/modules/shortcut/src/Plugin/migrate/destination/ShortcutSetUsers.php index 557fea3..1f0c2d8 100644 --- a/core/modules/shortcut/src/Plugin/migrate/destination/ShortcutSetUsers.php +++ b/core/modules/shortcut/src/Plugin/migrate/destination/ShortcutSetUsers.php @@ -9,7 +9,7 @@ use Drupal\shortcut\ShortcutSetStorageInterface; use Drupal\user\Entity\User; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Row; use Drupal\migrate\Plugin\migrate\destination\DestinationBase; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -38,7 +38,7 @@ class ShortcutSetUsers extends DestinationBase implements ContainerFactoryPlugin * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. - * @param MigrationInterface $migration + * @param \Drupal\migrate\MigrationInterface $migration * The migration. * @param \Drupal\shortcut\ShortcutSetStorageInterface $shortcut_set_storage * The shortcut_set entity storage handler. diff --git a/core/modules/taxonomy/src/Plugin/migrate/cckfield/TaxonomyTermReference.php b/core/modules/taxonomy/src/Plugin/migrate/cckfield/TaxonomyTermReference.php index d6de1ec..a7bbb49 100644 --- a/core/modules/taxonomy/src/Plugin/migrate/cckfield/TaxonomyTermReference.php +++ b/core/modules/taxonomy/src/Plugin/migrate/cckfield/TaxonomyTermReference.php @@ -7,7 +7,7 @@ namespace Drupal\taxonomy\Plugin\migrate\cckfield; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate_drupal\Plugin\migrate\cckfield\CckFieldPluginBase; /** diff --git a/core/modules/text/src/Plugin/migrate/cckfield/TextField.php b/core/modules/text/src/Plugin/migrate/cckfield/TextField.php index a386b5f..1632d43 100644 --- a/core/modules/text/src/Plugin/migrate/cckfield/TextField.php +++ b/core/modules/text/src/Plugin/migrate/cckfield/TextField.php @@ -7,7 +7,7 @@ namespace Drupal\text\Plugin\migrate\cckfield; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Row; use Drupal\migrate_drupal\Plugin\migrate\cckfield\CckFieldPluginBase; diff --git a/core/modules/text/tests/src/Unit/Migrate/TextFieldTest.php b/core/modules/text/tests/src/Unit/Migrate/TextFieldTest.php index 117919d..07e63ce 100644 --- a/core/modules/text/tests/src/Unit/Migrate/TextFieldTest.php +++ b/core/modules/text/tests/src/Unit/Migrate/TextFieldTest.php @@ -7,7 +7,7 @@ namespace Drupal\Tests\text\Unit\Migrate; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\Row; use Drupal\Tests\UnitTestCase; use Drupal\text\Plugin\migrate\cckfield\TextField; @@ -25,7 +25,7 @@ class TextFieldTest extends UnitTestCase { protected $plugin; /** - * @var \Drupal\migrate\Entity\MigrationInterface + * @var \Drupal\migrate\MigrationInterface */ protected $migration; diff --git a/core/modules/user/src/Plugin/migrate/destination/EntityUser.php b/core/modules/user/src/Plugin/migrate/destination/EntityUser.php index beda7c8..60159df 100644 --- a/core/modules/user/src/Plugin/migrate/destination/EntityUser.php +++ b/core/modules/user/src/Plugin/migrate/destination/EntityUser.php @@ -13,7 +13,7 @@ use Drupal\Core\Field\FieldTypePluginManagerInterface; use Drupal\Core\Field\Plugin\Field\FieldType\EmailItem; use Drupal\Core\Password\PasswordInterface; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\migrate\MigrateException; use Drupal\user\MigratePassword; use Drupal\migrate\Plugin\migrate\destination\EntityContentBase; @@ -43,7 +43,7 @@ class EntityUser extends EntityContentBase { * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. - * @param MigrationInterface $migration + * @param \Drupal\migrate\MigrationInterface $migration * The migration. * @param EntityStorageInterface $storage * The storage for this entity type. diff --git a/core/modules/user/src/Plugin/migrate/destination/UserData.php b/core/modules/user/src/Plugin/migrate/destination/UserData.php index 5ae639f..29da198 100644 --- a/core/modules/user/src/Plugin/migrate/destination/UserData.php +++ b/core/modules/user/src/Plugin/migrate/destination/UserData.php @@ -7,7 +7,7 @@ namespace Drupal\user\Plugin\migrate\destination; -use Drupal\migrate\Entity\MigrationInterface; +use Drupal\migrate\MigrationInterface; use Drupal\user\UserData as UserDataStorage; use Drupal\migrate\Row; use Drupal\migrate\Plugin\migrate\destination\DestinationBase; @@ -35,7 +35,7 @@ class UserData extends DestinationBase implements ContainerFactoryPluginInterfac * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. - * @param \Drupal\migrate\Entity\MigrationInterface $migration + * @param \Drupal\migrate\MigrationInterface $migration * The migration. * @param \Drupal\user\UserData $user_data * The user data service. diff --git a/core/modules/user/src/Tests/Migrate/d6/MigrateUserPictureFileTest.php b/core/modules/user/src/Tests/Migrate/d6/MigrateUserPictureFileTest.php index 9f7b20a..172d9ae 100644 --- a/core/modules/user/src/Tests/Migrate/d6/MigrateUserPictureFileTest.php +++ b/core/modules/user/src/Tests/Migrate/d6/MigrateUserPictureFileTest.php @@ -26,7 +26,7 @@ protected function setUp() { $this->installEntitySchema('file'); - /** @var \Drupal\migrate\Entity\MigrationInterface $migration */ + /** @var \Drupal\migrate\MigrationInterface $migration */ $migration = Migration::load('d6_user_picture_file'); $source = $migration->get('source'); $source['site_path'] = 'core/modules/simpletest'; diff --git a/core/modules/user/src/Tests/Migrate/d6/ProfileValuesBuilderTest.php b/core/modules/user/src/Tests/Migrate/d6/ProfileValuesBuilderTest.php index fe623ae..9d35d04 100644 --- a/core/modules/user/src/Tests/Migrate/d6/ProfileValuesBuilderTest.php +++ b/core/modules/user/src/Tests/Migrate/d6/ProfileValuesBuilderTest.php @@ -21,7 +21,7 @@ class ProfileValuesBuilderTest extends MigrateDrupal6TestBase { public function testBuilder() { $template = \Drupal::service('migrate.template_storage') ->getTemplateByName('d6_profile_values'); - /** @var \Drupal\migrate\Entity\MigrationInterface[] $migrations */ + /** @var \Drupal\migrate\MigrationInterface[] $migrations */ $migrations = \Drupal::service('plugin.manager.migrate.builder') ->createInstance('d6_profile_values') ->buildMigrations($template); diff --git a/core/modules/user/src/Tests/Migrate/d7/UserMigrationBuilderTest.php b/core/modules/user/src/Tests/Migrate/d7/UserMigrationBuilderTest.php index 09fae9e..eceb414 100644 --- a/core/modules/user/src/Tests/Migrate/d7/UserMigrationBuilderTest.php +++ b/core/modules/user/src/Tests/Migrate/d7/UserMigrationBuilderTest.php @@ -21,7 +21,7 @@ class UserMigrationBuilderTest extends MigrateDrupal7TestBase { public function testBuilder() { $template = \Drupal::service('migrate.template_storage') ->getTemplateByName('d7_user'); - /** @var \Drupal\migrate\Entity\MigrationInterface[] $migrations */ + /** @var \Drupal\migrate\MigrationInterface[] $migrations */ $migrations = \Drupal::service('plugin.manager.migrate.builder') ->createInstance('d7_user') ->buildMigrations($template);