Issue #3097439 by andypost, longwave, martin107: Remove all @deprecated code in the Config module

merge-requests/2419/head
Lee Rowlands 2019-12-02 11:38:11 +10:00
parent bb6797a8e2
commit 7ab5bbcee4
No known key found for this signature in database
GPG Key ID: 2B829A3DF9204DC4
5 changed files with 3 additions and 120 deletions

View File

@ -113,22 +113,14 @@ class ConfigController implements ContainerInjectionInterface {
* @param \Drupal\Core\Config\ImportStorageTransformer $import_transformer
* The import transformer service.
*/
public function __construct(StorageInterface $target_storage, StorageInterface $sync_storage, ConfigManagerInterface $config_manager, FileDownloadController $file_download_controller, DiffFormatter $diff_formatter, FileSystemInterface $file_system, StorageInterface $export_storage = NULL, ImportStorageTransformer $import_transformer = NULL) {
public function __construct(StorageInterface $target_storage, StorageInterface $sync_storage, ConfigManagerInterface $config_manager, FileDownloadController $file_download_controller, DiffFormatter $diff_formatter, FileSystemInterface $file_system, StorageInterface $export_storage, ImportStorageTransformer $import_transformer) {
$this->targetStorage = $target_storage;
$this->syncStorage = $sync_storage;
$this->configManager = $config_manager;
$this->fileDownloadController = $file_download_controller;
$this->diffFormatter = $diff_formatter;
$this->fileSystem = $file_system;
if (is_null($export_storage)) {
@trigger_error('The config.storage.export service must be passed to ConfigController::__construct(), it is required before Drupal 9.0.0. See https://www.drupal.org/node/3037022.', E_USER_DEPRECATED);
$export_storage = \Drupal::service('config.storage.export');
}
$this->exportStorage = $export_storage;
if (is_null($import_transformer)) {
@trigger_error('The config.import_transformer service must be passed to ConfigController::__construct(), it is required before Drupal 9.0.0. See https://www.drupal.org/node/3066005.', E_USER_DEPRECATED);
$import_transformer = \Drupal::service('config.import_transformer');
}
$this->importTransformer = $import_transformer;
}

View File

@ -48,17 +48,9 @@ class ConfigImportForm extends FormBase {
* @param \Drupal\Core\Site\Settings $settings
* The settings object.
*/
public function __construct(StorageInterface $config_storage, FileSystemInterface $file_system = NULL, Settings $settings = NULL) {
public function __construct(StorageInterface $config_storage, FileSystemInterface $file_system, Settings $settings) {
$this->configStorage = $config_storage;
if (!isset($file_system)) {
@trigger_error('The $file_system parameter was added in Drupal 8.8.0 and will be required in 9.0.0. See https://www.drupal.org/node/3021434.', E_USER_DEPRECATED);
$file_system = \Drupal::service('file_system');
}
$this->fileSystem = $file_system;
if (!isset($settings)) {
@trigger_error('The $settings parameter was added in Drupal 8.8.0 and will be required in 9.0.0. See https://www.drupal.org/node/2980712.', E_USER_DEPRECATED);
$settings = \Drupal::service('settings');
}
$this->settings = $settings;
}

View File

@ -150,7 +150,7 @@ class ConfigSync extends FormBase {
* @param \Drupal\Core\Config\ImportStorageTransformer $import_transformer
* The import transformer service.
*/
public function __construct(StorageInterface $sync_storage, StorageInterface $active_storage, StorageInterface $snapshot_storage, LockBackendInterface $lock, EventDispatcherInterface $event_dispatcher, ConfigManagerInterface $config_manager, TypedConfigManagerInterface $typed_config, ModuleHandlerInterface $module_handler, ModuleInstallerInterface $module_installer, ThemeHandlerInterface $theme_handler, RendererInterface $renderer, ModuleExtensionList $extension_list_module, ImportStorageTransformer $import_transformer = NULL) {
public function __construct(StorageInterface $sync_storage, StorageInterface $active_storage, StorageInterface $snapshot_storage, LockBackendInterface $lock, EventDispatcherInterface $event_dispatcher, ConfigManagerInterface $config_manager, TypedConfigManagerInterface $typed_config, ModuleHandlerInterface $module_handler, ModuleInstallerInterface $module_installer, ThemeHandlerInterface $theme_handler, RendererInterface $renderer, ModuleExtensionList $extension_list_module, ImportStorageTransformer $import_transformer) {
$this->syncStorage = $sync_storage;
$this->activeStorage = $active_storage;
$this->snapshotStorage = $snapshot_storage;
@ -163,10 +163,6 @@ class ConfigSync extends FormBase {
$this->themeHandler = $theme_handler;
$this->renderer = $renderer;
$this->moduleExtensionList = $extension_list_module;
if (is_null($import_transformer)) {
@trigger_error('The config.import_transformer service must be passed to ConfigSync::__construct(), it is required before Drupal 9.0.0. See https://www.drupal.org/node/3066005.', E_USER_DEPRECATED);
$import_transformer = \Drupal::service('config.import_transformer');
}
$this->importTransformer = $import_transformer;
}
@ -390,40 +386,4 @@ class ConfigSync extends FormBase {
}
}
/**
* Processes the config import batch and persists the importer.
*
* @param \Drupal\Core\Config\ConfigImporter $config_importer
* The batch config importer object to persist.
* @param string $sync_step
* The synchronization step to do.
* @param array $context
* The batch context.
*
* @deprecated in drupal:8.6.0 and is removed from drupal:9.0.0. Use
* \Drupal\Core\Config\Importer\ConfigImporterBatch::process() instead.
*
* @see https://www.drupal.org/node/2897299
*/
public static function processBatch(ConfigImporter $config_importer, $sync_step, &$context) {
@trigger_error('\Drupal\config\Form\ConfigSync::processBatch() deprecated in Drupal 8.6.0 and will be removed before 9.0.0. Use \Drupal\Core\Config\Importer\ConfigImporterBatch::process() instead. See https://www.drupal.org/node/2897299');
ConfigImporterBatch::process($config_importer, $sync_step, $context);
}
/**
* Finish batch.
*
* This function is a static function to avoid serializing the ConfigSync
* object unnecessarily.
*
* @deprecated in drupal:8.6.0 and is removed from drupal:9.0.0. Use
* \Drupal\Core\Config\Importer\ConfigImporterBatch::finish() instead.
*
* @see https://www.drupal.org/node/2897299
*/
public static function finishBatch($success, $results, $operations) {
@trigger_error('\Drupal\config\Form\ConfigSync::finishBatch() deprecated in Drupal 8.6.0 and will be removed before 9.0.0. Use \Drupal\Core\Config\Importer\ConfigImporterBatch::finish() instead. See https://www.drupal.org/node/2897299');
ConfigImporterBatch::finish($success, $results, $operations);
}
}

View File

@ -1,44 +0,0 @@
<?php
namespace Drupal\config\Tests;
@trigger_error('The ' . __NAMESPACE__ . '\AssertConfigEntityImportTrait is deprecated in Drupal 8.4.1 and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\config\Traits\AssertConfigEntityImportTrait. See https://www.drupal.org/node/2916197.', E_USER_DEPRECATED);
use Drupal\Core\Config\Entity\ConfigEntityInterface;
/**
* Provides test assertions for testing config entity synchronization.
*
* Can be used by test classes that extend \Drupal\simpletest\WebTestBase or
* \Drupal\KernelTests\KernelTestBase.
*
* @deprecated in drupal:8.4.1 and is removed from drupal:9.0.0.
* Use \Drupal\Tests\config\Traits\AssertConfigEntityImportTrait.
*
* @see https://www.drupal.org/node/2916197
*/
trait AssertConfigEntityImportTrait {
/**
* Asserts that a config entity can be imported without changing it.
*
* @param \Drupal\Core\Config\Entity\ConfigEntityInterface $entity
* The config entity to test importing.
*/
public function assertConfigEntityImport(ConfigEntityInterface $entity) {
// Save original config information.
$entity_uuid = $entity->uuid();
$entity_type_id = $entity->getEntityTypeId();
$original_data = $entity->toArray();
// Copy everything to sync.
$this->copyConfig(\Drupal::service('config.storage'), \Drupal::service('config.storage.sync'));
// Delete the configuration from active. Don't worry about side effects of
// deleting config like fields cleaning up field storages. The coming import
// should recreate everything as necessary.
$entity->delete();
$this->configImporter()->reset()->import();
$imported_entity = \Drupal::service('entity.repository')->loadEntityByUuid($entity_type_id, $entity_uuid);
$this->assertIdentical($original_data, $imported_entity->toArray());
}
}

View File

@ -1,17 +0,0 @@
<?php
namespace Drupal\config\Tests;
@trigger_error(__NAMESPACE__ . '\SchemaCheckTestTrait is deprecated as of 8.3.x, will be removed in before Drupal 9.0.0. Use \Drupal\Tests\SchemaCheckTestTrait instead.', E_USER_DEPRECATED);
/**
* Provides a class for checking configuration schema.
*
* @deprecated in drupal:8.3.0 and is removed from drupal:9.0.0. Use
* \Drupal\Tests\SchemaCheckTestTrait instead.
*/
trait SchemaCheckTestTrait {
use \Drupal\Tests\SchemaCheckTestTrait;
}