Skip to content
Snippets Groups Projects
Commit 9228776a authored by catch's avatar catch
Browse files

Issue #3443205 by andypost, smustgrave: Remove deprecated code from migration modules

parent 16256316
No related branches found
No related tags found
No related merge requests found
...@@ -86,13 +86,6 @@ class Config extends DestinationBase implements ContainerFactoryPluginInterface, ...@@ -86,13 +86,6 @@ class Config extends DestinationBase implements ContainerFactoryPluginInterface,
*/ */
protected $language_manager; protected $language_manager;
/**
* The typed config manager service.
*
* @var \Drupal\Core\Config\TypedConfigManagerInterface
*/
protected TypedConfigManagerInterface $typedConfigManager;
/** /**
* Constructs a Config destination object. * Constructs a Config destination object.
* *
...@@ -108,21 +101,24 @@ class Config extends DestinationBase implements ContainerFactoryPluginInterface, ...@@ -108,21 +101,24 @@ class Config extends DestinationBase implements ContainerFactoryPluginInterface,
* The configuration factory. * The configuration factory.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager. * The language manager.
* @param \Drupal\Core\Config\TypedConfigManagerInterface $typed_config_manager * @param \Drupal\Core\Config\TypedConfigManagerInterface $typedConfigManager
* The typed config manager. * The typed config manager.
*/ */
public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, ConfigFactoryInterface $config_factory, LanguageManagerInterface $language_manager, TypedConfigManagerInterface $typed_config_manager = NULL) { public function __construct(
array $configuration,
$plugin_id,
$plugin_definition,
MigrationInterface $migration,
ConfigFactoryInterface $config_factory,
LanguageManagerInterface $language_manager,
protected TypedConfigManagerInterface $typedConfigManager,
) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $migration); parent::__construct($configuration, $plugin_id, $plugin_definition, $migration);
$this->config = $config_factory->getEditable($configuration['config_name']); $this->config = $config_factory->getEditable($configuration['config_name']);
$this->language_manager = $language_manager; $this->language_manager = $language_manager;
if ($this->isTranslationDestination()) { if ($this->isTranslationDestination()) {
$this->supportsRollback = TRUE; $this->supportsRollback = TRUE;
} }
if ($typed_config_manager === NULL) {
@trigger_error('Calling ' . __METHOD__ . '() without the $typed_config_manager argument is deprecated in drupal:10.3.0 and is removed in drupal:11.0.0. See https://www.drupal.org/node/3440502', E_USER_DEPRECATED);
$typed_config_manager = \Drupal::service(TypedConfigManagerInterface::class);
}
$this->typedConfigManager = $typed_config_manager;
} }
/** /**
......
...@@ -5,10 +5,8 @@ ...@@ -5,10 +5,8 @@
use Drupal\Component\Datetime\TimeInterface; use Drupal\Component\Datetime\TimeInterface;
use Drupal\Core\Batch\BatchBuilder; use Drupal\Core\Batch\BatchBuilder;
use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\DependencyInjection\DeprecatedServicePropertyTrait;
use Drupal\Core\Extension\Exception\UnknownExtensionException; use Drupal\Core\Extension\Exception\UnknownExtensionException;
use Drupal\Core\Extension\ModuleExtensionList; use Drupal\Core\Extension\ModuleExtensionList;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\State\StateInterface; use Drupal\Core\State\StateInterface;
use Drupal\Core\TempStore\PrivateTempStoreFactory; use Drupal\Core\TempStore\PrivateTempStoreFactory;
...@@ -35,12 +33,6 @@ ...@@ -35,12 +33,6 @@
* @internal * @internal
*/ */
class ReviewForm extends MigrateUpgradeFormBase { class ReviewForm extends MigrateUpgradeFormBase {
use DeprecatedServicePropertyTrait;
/**
* The service properties that should raise a deprecation error.
*/
private array $deprecatedProperties = ['moduleHandler' => 'module_handler'];
/** /**
* The migrations. * The migrations.
...@@ -56,11 +48,6 @@ class ReviewForm extends MigrateUpgradeFormBase { ...@@ -56,11 +48,6 @@ class ReviewForm extends MigrateUpgradeFormBase {
*/ */
protected $migrationState; protected $migrationState;
/**
* Module extension list.
*/
protected ModuleExtensionList $moduleExtensionList;
/** /**
* Source system data set in buildForm(). * Source system data set in buildForm().
* *
...@@ -81,9 +68,9 @@ class ReviewForm extends MigrateUpgradeFormBase { ...@@ -81,9 +68,9 @@ class ReviewForm extends MigrateUpgradeFormBase {
* Migration state service. * Migration state service.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory service. * The config factory service.
* @param \Drupal\Core\Extension\ModuleExtensionList|\Drupal\Core\Extension\ModuleHandlerInterface $module_extension_list * @param \Drupal\Core\Extension\ModuleExtensionList $moduleExtensionList
* The module extension list. * The module extension list.
* @param \Drupal\Component\Datetime\TimeInterface|null $time * @param \Drupal\Component\Datetime\TimeInterface $time
* The time service. * The time service.
*/ */
public function __construct( public function __construct(
...@@ -92,20 +79,11 @@ public function __construct( ...@@ -92,20 +79,11 @@ public function __construct(
PrivateTempStoreFactory $tempstore_private, PrivateTempStoreFactory $tempstore_private,
MigrationState $migrationState, MigrationState $migrationState,
ConfigFactoryInterface $config_factory, ConfigFactoryInterface $config_factory,
ModuleExtensionList|ModuleHandlerInterface $module_extension_list, protected ModuleExtensionList $moduleExtensionList,
protected ?TimeInterface $time = NULL, protected TimeInterface $time,
) { ) {
parent::__construct($config_factory, $migration_plugin_manager, $state, $tempstore_private); parent::__construct($config_factory, $migration_plugin_manager, $state, $tempstore_private);
$this->migrationState = $migrationState; $this->migrationState = $migrationState;
if ($this->time === NULL) {
@trigger_error('Calling ' . __METHOD__ . ' without the $time argument is deprecated in drupal:10.3.0 and it will be required in drupal:11.0.0. See https://www.drupal.org/node/3112298', E_USER_DEPRECATED);
$this->time = \Drupal::service('datetime.time');
}
if ($module_extension_list instanceof ModuleHandlerInterface) {
@trigger_error('Calling ' . __METHOD__ . '() with the $module_extension_list argument as ModuleHandlerInterface is deprecated in drupal:10.3.0 and will be required in drupal:12.0.0. See https://www.drupal.org/node/3310017', E_USER_DEPRECATED);
$module_extension_list = \Drupal::service('extension.list.module');
}
$this->moduleExtensionList = $module_extension_list;
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment