From fe628416dc79b53827d35a1d73b826d153c29ec8 Mon Sep 17 00:00:00 2001 From: alexpott Date: Tue, 7 Jan 2025 21:08:42 +0000 Subject: [PATCH] Allow config.storage service to be decorated (#6197) --- src/Commands/config/ConfigCommands.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/Commands/config/ConfigCommands.php b/src/Commands/config/ConfigCommands.php index a2830f7cf6..fc37a2ad06 100644 --- a/src/Commands/config/ConfigCommands.php +++ b/src/Commands/config/ConfigCommands.php @@ -16,7 +16,6 @@ use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Config\FileStorage; use Drupal\Core\Config\ImportStorageTransformer; -use Drupal\Core\Config\StorageCacheInterface; use Drupal\Core\Config\StorageComparer; use Drupal\Core\Config\StorageInterface; use Drupal\Core\Config\StorageManagerInterface; @@ -33,6 +32,7 @@ use Symfony\Component\Console\Completion\CompletionSuggestions; use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\DependencyInjection\Attribute\Autowire; use Symfony\Component\Filesystem\Path; use Symfony\Component\Yaml\Parser; @@ -57,7 +57,8 @@ public function getConfigFactory(): ConfigFactoryInterface public function __construct( protected ConfigFactoryInterface $configFactory, - protected StorageCacheInterface $configStorage, + #[Autowire(service: 'config.storage')] + protected StorageInterface $configStorage, protected SiteAliasManagerInterface $siteAliasManager, protected StorageManagerInterface $configStorageExport, protected ImportStorageTransformer $importStorageTransformer, @@ -65,14 +66,6 @@ public function __construct( parent::__construct(); } - public function getConfigStorageExport(): StorageManagerInterface|StorageCacheInterface - { - if (isset($this->configStorageExport)) { - return $this->configStorageExport; - } - return $this->configStorage; - } - public function hasImportTransformer(): bool { return isset($this->importStorageTransformer);