Commit 0d74926e authored by alexpott's avatar alexpott

Issue #2787619 by hussainweb, phenaproxima, alexpott: CckMigration does not...

Issue #2787619 by hussainweb, phenaproxima, alexpott: CckMigration does not type hint CckPluginManager correctly
parent 78714b90
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
namespace Drupal\field\Plugin\migrate\process; namespace Drupal\field\Plugin\migrate\process;
use Drupal\Component\Plugin\Exception\PluginNotFoundException; use Drupal\Component\Plugin\Exception\PluginNotFoundException;
use Drupal\Component\Plugin\PluginManagerInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\migrate\MigrateExecutableInterface; use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate\Plugin\MigrationInterface;
use Drupal\migrate\Plugin\migrate\process\StaticMap; use Drupal\migrate\Plugin\migrate\process\StaticMap;
use Drupal\migrate\Row; use Drupal\migrate\Row;
use Drupal\migrate_drupal\Plugin\MigrateCckFieldPluginManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
...@@ -21,7 +21,7 @@ class FieldType extends StaticMap implements ContainerFactoryPluginInterface { ...@@ -21,7 +21,7 @@ class FieldType extends StaticMap implements ContainerFactoryPluginInterface {
/** /**
* The cckfield plugin manager. * The cckfield plugin manager.
* *
* @var \Drupal\Component\Plugin\PluginManagerInterface * @var \Drupal\migrate_drupal\Plugin\MigrateCckFieldPluginManagerInterface
*/ */
protected $cckPluginManager; protected $cckPluginManager;
...@@ -41,12 +41,12 @@ class FieldType extends StaticMap implements ContainerFactoryPluginInterface { ...@@ -41,12 +41,12 @@ class FieldType extends StaticMap implements ContainerFactoryPluginInterface {
* The plugin ID. * The plugin ID.
* @param mixed $plugin_definition * @param mixed $plugin_definition
* The plugin definition. * The plugin definition.
* @param \Drupal\Component\Plugin\PluginManagerInterface $cck_plugin_manager * @param \Drupal\migrate_drupal\Plugin\MigrateCckFieldPluginManagerInterface $cck_plugin_manager
* The cckfield plugin manager. * The cckfield plugin manager.
* @param \Drupal\migrate\Plugin\MigrationInterface $migration * @param \Drupal\migrate\Plugin\MigrationInterface $migration
* The migration being run. * The migration being run.
*/ */
public function __construct(array $configuration, $plugin_id, $plugin_definition, PluginManagerInterface $cck_plugin_manager, MigrationInterface $migration = NULL) { public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrateCckFieldPluginManagerInterface $cck_plugin_manager, MigrationInterface $migration = NULL) {
parent::__construct($configuration, $plugin_id, $plugin_definition); parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->cckPluginManager = $cck_plugin_manager; $this->cckPluginManager = $cck_plugin_manager;
$this->migration = $migration; $this->migration = $migration;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* *
* @ingroup migration * @ingroup migration
*/ */
class MigratePluginManager extends DefaultPluginManager { class MigratePluginManager extends DefaultPluginManager implements MigratePluginManagerInterface {
/** /**
* Constructs a MigratePluginManager object. * Constructs a MigratePluginManager object.
...@@ -49,8 +49,6 @@ public function __construct($type, \Traversable $namespaces, CacheBackendInterfa ...@@ -49,8 +49,6 @@ public function __construct($type, \Traversable $namespaces, CacheBackendInterfa
/** /**
* {@inheritdoc} * {@inheritdoc}
*
* A specific createInstance method is necessary to pass the migration on.
*/ */
public function createInstance($plugin_id, array $configuration = array(), MigrationInterface $migration = NULL) { public function createInstance($plugin_id, array $configuration = array(), MigrationInterface $migration = NULL) {
$plugin_definition = $this->getDefinition($plugin_id); $plugin_definition = $this->getDefinition($plugin_id);
......
<?php
namespace Drupal\migrate\Plugin;
use Drupal\Component\Plugin\PluginManagerInterface;
interface MigratePluginManagerInterface extends PluginManagerInterface {
/**
* Creates a pre-configured instance of a migration plugin.
*
* A specific createInstance method is necessary to pass the migration on.
*
* @param string $plugin_id
* The ID of the plugin being instantiated.
* @param array $configuration
* An array of configuration relevant to the plugin instance.
* @param \Drupal\migrate\Plugin\MigrationInterface $migration
* The migration context in which the plugin will run.
*
* @return object
* A fully configured plugin instance.
*
* @throws \Drupal\Component\Plugin\Exception\PluginException
* If the instance cannot be created, such as if the ID is invalid.
*/
public function createInstance($plugin_id, array $configuration = [], MigrationInterface $migration = NULL);
}
...@@ -275,16 +275,16 @@ class Migration extends PluginBase implements MigrationInterface, RequirementsIn ...@@ -275,16 +275,16 @@ class Migration extends PluginBase implements MigrationInterface, RequirementsIn
* The plugin definition. * The plugin definition.
* @param \Drupal\migrate\Plugin\MigrationPluginManagerInterface $migration_plugin_manager * @param \Drupal\migrate\Plugin\MigrationPluginManagerInterface $migration_plugin_manager
* The migration plugin manager. * The migration plugin manager.
* @param \Drupal\migrate\Plugin\MigratePluginManager $source_plugin_manager * @param \Drupal\migrate\Plugin\MigratePluginManagerInterface $source_plugin_manager
* The source migration plugin manager. * The source migration plugin manager.
* @param \Drupal\migrate\Plugin\MigratePluginManager $process_plugin_manager * @param \Drupal\migrate\Plugin\MigratePluginManagerInterface $process_plugin_manager
* The process migration plugin manager. * The process migration plugin manager.
* @param \Drupal\migrate\Plugin\MigrateDestinationPluginManager $destination_plugin_manager * @param \Drupal\migrate\Plugin\MigrateDestinationPluginManager $destination_plugin_manager
* The destination migration plugin manager. * The destination migration plugin manager.
* @param \Drupal\migrate\Plugin\MigratePluginManager $idmap_plugin_manager * @param \Drupal\migrate\Plugin\MigratePluginManagerInterface $idmap_plugin_manager
* The ID map migration plugin manager. * The ID map migration plugin manager.
*/ */
public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationPluginManagerInterface $migration_plugin_manager, MigratePluginManager $source_plugin_manager, MigratePluginManager $process_plugin_manager, MigrateDestinationPluginManager $destination_plugin_manager, MigratePluginManager $idmap_plugin_manager) { public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationPluginManagerInterface $migration_plugin_manager, MigratePluginManagerInterface $source_plugin_manager, MigratePluginManagerInterface $process_plugin_manager, MigrateDestinationPluginManager $destination_plugin_manager, MigratePluginManagerInterface $idmap_plugin_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition); parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->migrationPluginManager = $migration_plugin_manager; $this->migrationPluginManager = $migration_plugin_manager;
$this->sourcePluginManager = $source_plugin_manager; $this->sourcePluginManager = $source_plugin_manager;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\migrate\MigrateSkipProcessException; use Drupal\migrate\MigrateSkipProcessException;
use Drupal\migrate\Plugin\MigratePluginManager; use Drupal\migrate\Plugin\MigratePluginManagerInterface;
use Drupal\migrate\Plugin\MigrationPluginManagerInterface; use Drupal\migrate\Plugin\MigrationPluginManagerInterface;
use Drupal\migrate\Plugin\MigrateIdMapInterface; use Drupal\migrate\Plugin\MigrateIdMapInterface;
use Drupal\migrate\ProcessPluginBase; use Drupal\migrate\ProcessPluginBase;
...@@ -39,7 +39,7 @@ class Migration extends ProcessPluginBase implements ContainerFactoryPluginInter ...@@ -39,7 +39,7 @@ class Migration extends ProcessPluginBase implements ContainerFactoryPluginInter
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, MigrationPluginManagerInterface $migration_plugin_manager, MigratePluginManager $process_plugin_manager) { public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, MigrationPluginManagerInterface $migration_plugin_manager, MigratePluginManagerInterface $process_plugin_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition); parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->migrationPluginManager = $migration_plugin_manager; $this->migrationPluginManager = $migration_plugin_manager;
$this->migration = $migration; $this->migration = $migration;
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* *
* @ingroup migration * @ingroup migration
*/ */
class MigrateCckFieldPluginManager extends MigratePluginManager { class MigrateCckFieldPluginManager extends MigratePluginManager implements MigrateCckFieldPluginManagerInterface {
/** /**
* The default version of core to use for cck field plugins. * The default version of core to use for cck field plugins.
...@@ -27,20 +27,7 @@ class MigrateCckFieldPluginManager extends MigratePluginManager { ...@@ -27,20 +27,7 @@ class MigrateCckFieldPluginManager extends MigratePluginManager {
const DEFAULT_CORE_VERSION = 6; const DEFAULT_CORE_VERSION = 6;
/** /**
* Get the plugin ID from the field type. * {@inheritdoc}
*
* @param string $field_type
* The field type being migrated.
* @param array $configuration
* (optioanl) An array of configuration relevant to the plugin instance.
* @param \Drupal\migrate\Plugin\MigrationInterface|null $migration
* (optional) The current migration instance.
*
* @return string
* The ID of the plugin for the field_type if available.
*
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
* If the plugin cannot be determined, such as if the field type is invalid.
*/ */
public function getPluginIdFromFieldType($field_type, array $configuration = [], MigrationInterface $migration = NULL) { public function getPluginIdFromFieldType($field_type, array $configuration = [], MigrationInterface $migration = NULL) {
$core = static::DEFAULT_CORE_VERSION; $core = static::DEFAULT_CORE_VERSION;
......
<?php
namespace Drupal\migrate_drupal\Plugin;
use Drupal\migrate\Plugin\MigratePluginManagerInterface;
use Drupal\migrate\Plugin\MigrationInterface;
interface MigrateCckFieldPluginManagerInterface extends MigratePluginManagerInterface {
/**
* Get the plugin ID from the field type.
*
* @param string $field_type
* The field type being migrated.
* @param array $configuration
* (optional) An array of configuration relevant to the plugin instance.
* @param \Drupal\migrate\Plugin\MigrationInterface|null $migration
* (optional) The current migration instance.
*
* @return string
* The ID of the plugin for the field_type if available.
*
* @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
* If the plugin cannot be determined, such as if the field type is invalid.
*/
public function getPluginIdFromFieldType($field_type, array $configuration = [], MigrationInterface $migration = NULL);
}
...@@ -6,10 +6,11 @@ ...@@ -6,10 +6,11 @@
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\migrate\Exception\RequirementsException; use Drupal\migrate\Exception\RequirementsException;
use Drupal\migrate\Plugin\MigrateDestinationPluginManager; use Drupal\migrate\Plugin\MigrateDestinationPluginManager;
use Drupal\migrate\Plugin\MigratePluginManager; use Drupal\migrate\Plugin\MigratePluginManagerInterface;
use Drupal\migrate\Plugin\Migration; use Drupal\migrate\Plugin\Migration;
use Drupal\migrate\Plugin\MigrationPluginManagerInterface; use Drupal\migrate\Plugin\MigrationPluginManagerInterface;
use Drupal\migrate\Plugin\RequirementsInterface; use Drupal\migrate\Plugin\RequirementsInterface;
use Drupal\migrate_drupal\Plugin\MigrateCckFieldPluginManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
...@@ -41,7 +42,7 @@ class CckMigration extends Migration implements ContainerFactoryPluginInterface ...@@ -41,7 +42,7 @@ class CckMigration extends Migration implements ContainerFactoryPluginInterface
/** /**
* The cckfield plugin manager. * The cckfield plugin manager.
* *
* @var \Drupal\migrate\Plugin\MigratePluginManager * @var \Drupal\migrate_drupal\Plugin\MigrateCckFieldPluginManagerInterface
*/ */
protected $cckPluginManager; protected $cckPluginManager;
...@@ -54,20 +55,20 @@ class CckMigration extends Migration implements ContainerFactoryPluginInterface ...@@ -54,20 +55,20 @@ class CckMigration extends Migration implements ContainerFactoryPluginInterface
* The plugin ID. * The plugin ID.
* @param mixed $plugin_definition * @param mixed $plugin_definition
* The plugin definition. * The plugin definition.
* @param \Drupal\migrate\Plugin\MigratePluginManager $cck_manager * @param \Drupal\migrate_drupal\Plugin\MigrateCckFieldPluginManagerInterface $cck_manager
* The cckfield plugin manager. * The cckfield plugin manager.
* @param \Drupal\migrate\Plugin\MigrationPluginManagerInterface $migration_plugin_manager * @param \Drupal\migrate\Plugin\MigrationPluginManagerInterface $migration_plugin_manager
* The migration plugin manager. * The migration plugin manager.
* @param \Drupal\migrate\Plugin\MigratePluginManager $source_plugin_manager * @param \Drupal\migrate\Plugin\MigratePluginManagerInterface $source_plugin_manager
* The source migration plugin manager. * The source migration plugin manager.
* @param \Drupal\migrate\Plugin\MigratePluginManager $process_plugin_manager * @param \Drupal\migrate\Plugin\MigratePluginManagerInterface $process_plugin_manager
* The process migration plugin manager. * The process migration plugin manager.
* @param \Drupal\migrate\Plugin\MigrateDestinationPluginManager $destination_plugin_manager * @param \Drupal\migrate\Plugin\MigrateDestinationPluginManager $destination_plugin_manager
* The destination migration plugin manager. * The destination migration plugin manager.
* @param \Drupal\migrate\Plugin\MigratePluginManager $idmap_plugin_manager * @param \Drupal\migrate\Plugin\MigratePluginManagerInterface $idmap_plugin_manager
* The ID map migration plugin manager. * The ID map migration plugin manager.
*/ */
public function __construct(array $configuration, $plugin_id, $plugin_definition, MigratePluginManager $cck_manager, MigrationPluginManagerInterface $migration_plugin_manager, MigratePluginManager $source_plugin_manager, MigratePluginManager $process_plugin_manager, MigrateDestinationPluginManager $destination_plugin_manager, MigratePluginManager $idmap_plugin_manager) { public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrateCckFieldPluginManagerInterface $cck_manager, MigrationPluginManagerInterface $migration_plugin_manager, MigratePluginManagerInterface $source_plugin_manager, MigratePluginManagerInterface $process_plugin_manager, MigrateDestinationPluginManager $destination_plugin_manager, MigratePluginManagerInterface $idmap_plugin_manager) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $migration_plugin_manager, $source_plugin_manager, $process_plugin_manager, $destination_plugin_manager, $idmap_plugin_manager); parent::__construct($configuration, $plugin_id, $plugin_definition, $migration_plugin_manager, $source_plugin_manager, $process_plugin_manager, $destination_plugin_manager, $idmap_plugin_manager);
$this->cckPluginManager = $cck_manager; $this->cckPluginManager = $cck_manager;
} }
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
use Drupal\Component\Plugin\Derivative\DeriverBase; use Drupal\Component\Plugin\Derivative\DeriverBase;
use Drupal\Component\Plugin\Exception\PluginNotFoundException; use Drupal\Component\Plugin\Exception\PluginNotFoundException;
use Drupal\Component\Plugin\PluginManagerInterface;
use Drupal\Core\Database\DatabaseExceptionWrapper; use Drupal\Core\Database\DatabaseExceptionWrapper;
use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface;
use Drupal\migrate\Exception\RequirementsException; use Drupal\migrate\Exception\RequirementsException;
use Drupal\migrate\Plugin\MigrationDeriverTrait; use Drupal\migrate\Plugin\MigrationDeriverTrait;
use Drupal\migrate_drupal\Plugin\MigrateCckFieldPluginManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
...@@ -34,7 +34,7 @@ class D6NodeDeriver extends DeriverBase implements ContainerDeriverInterface { ...@@ -34,7 +34,7 @@ class D6NodeDeriver extends DeriverBase implements ContainerDeriverInterface {
/** /**
* The CCK plugin manager. * The CCK plugin manager.
* *
* @var \Drupal\Component\Plugin\PluginManagerInterface * @var \Drupal\migrate_drupal\Plugin\MigrateCckFieldPluginManagerInterface
*/ */
protected $cckPluginManager; protected $cckPluginManager;
...@@ -50,12 +50,12 @@ class D6NodeDeriver extends DeriverBase implements ContainerDeriverInterface { ...@@ -50,12 +50,12 @@ class D6NodeDeriver extends DeriverBase implements ContainerDeriverInterface {
* *
* @param string $base_plugin_id * @param string $base_plugin_id
* The base plugin ID for the plugin ID. * The base plugin ID for the plugin ID.
* @param \Drupal\Component\Plugin\PluginManagerInterface $cck_manager * @param \Drupal\migrate_drupal\Plugin\MigrateCckFieldPluginManagerInterface $cck_manager
* The CCK plugin manager. * The CCK plugin manager.
* @param bool $translations * @param bool $translations
* Whether or not to include translations. * Whether or not to include translations.
*/ */
public function __construct($base_plugin_id, PluginManagerInterface $cck_manager, $translations) { public function __construct($base_plugin_id, MigrateCckFieldPluginManagerInterface $cck_manager, $translations) {
$this->basePluginId = $base_plugin_id; $this->basePluginId = $base_plugin_id;
$this->cckPluginManager = $cck_manager; $this->cckPluginManager = $cck_manager;
$this->includeTranslations = $translations; $this->includeTranslations = $translations;
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
use Drupal\Component\Plugin\Derivative\DeriverBase; use Drupal\Component\Plugin\Derivative\DeriverBase;
use Drupal\Component\Plugin\Exception\PluginNotFoundException; use Drupal\Component\Plugin\Exception\PluginNotFoundException;
use Drupal\Component\Plugin\PluginManagerInterface;
use Drupal\Core\Database\DatabaseExceptionWrapper; use Drupal\Core\Database\DatabaseExceptionWrapper;
use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface; use Drupal\Core\Plugin\Discovery\ContainerDeriverInterface;
use Drupal\migrate\Exception\RequirementsException; use Drupal\migrate\Exception\RequirementsException;
use Drupal\migrate\Plugin\MigrationDeriverTrait; use Drupal\migrate\Plugin\MigrationDeriverTrait;
use Drupal\migrate_drupal\Plugin\MigrateCckFieldPluginManagerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
...@@ -34,7 +34,7 @@ class D7NodeDeriver extends DeriverBase implements ContainerDeriverInterface { ...@@ -34,7 +34,7 @@ class D7NodeDeriver extends DeriverBase implements ContainerDeriverInterface {
/** /**
* The CCK plugin manager. * The CCK plugin manager.
* *
* @var \Drupal\Component\Plugin\PluginManagerInterface * @var \Drupal\migrate_drupal\Plugin\MigrateCckFieldPluginManagerInterface
*/ */
protected $cckPluginManager; protected $cckPluginManager;
...@@ -43,10 +43,10 @@ class D7NodeDeriver extends DeriverBase implements ContainerDeriverInterface { ...@@ -43,10 +43,10 @@ class D7NodeDeriver extends DeriverBase implements ContainerDeriverInterface {
* *
* @param string $base_plugin_id * @param string $base_plugin_id
* The base plugin ID for the plugin ID. * The base plugin ID for the plugin ID.
* @param \Drupal\Component\Plugin\PluginManagerInterface $cck_manager * @param \Drupal\migrate_drupal\Plugin\MigrateCckFieldPluginManagerInterface $cck_manager
* The CCK plugin manager. * The CCK plugin manager.
*/ */
public function __construct($base_plugin_id, PluginManagerInterface $cck_manager) { public function __construct($base_plugin_id, MigrateCckFieldPluginManagerInterface $cck_manager) {
$this->basePluginId = $base_plugin_id; $this->basePluginId = $base_plugin_id;
$this->cckPluginManager = $cck_manager; $this->cckPluginManager = $cck_manager;
} }
......
...@@ -43,8 +43,6 @@ class EntityUser extends EntityContentBase { ...@@ -43,8 +43,6 @@ class EntityUser extends EntityContentBase {
* The storage for this entity type. * The storage for this entity type.
* @param array $bundles * @param array $bundles
* The list of bundles this entity type has. * The list of bundles this entity type has.
* @param \Drupal\migrate\Plugin\MigratePluginManager $plugin_manager
* The migrate plugin manager.
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager service. * The entity manager service.
* @param \Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_manager * @param \Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_manager
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment