Skip to content

Commit fe62841

Browse files
authored
Allow config.storage service to be decorated (#6197)
1 parent 4a2db50 commit fe62841

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/Commands/config/ConfigCommands.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Drupal\Core\Config\ConfigFactoryInterface;
1717
use Drupal\Core\Config\FileStorage;
1818
use Drupal\Core\Config\ImportStorageTransformer;
19-
use Drupal\Core\Config\StorageCacheInterface;
2019
use Drupal\Core\Config\StorageComparer;
2120
use Drupal\Core\Config\StorageInterface;
2221
use Drupal\Core\Config\StorageManagerInterface;
@@ -33,6 +32,7 @@
3332
use Symfony\Component\Console\Completion\CompletionSuggestions;
3433
use Symfony\Component\Console\Helper\Table;
3534
use Symfony\Component\Console\Output\OutputInterface;
35+
use Symfony\Component\DependencyInjection\Attribute\Autowire;
3636
use Symfony\Component\Filesystem\Path;
3737
use Symfony\Component\Yaml\Parser;
3838

@@ -57,22 +57,15 @@ public function getConfigFactory(): ConfigFactoryInterface
5757

5858
public function __construct(
5959
protected ConfigFactoryInterface $configFactory,
60-
protected StorageCacheInterface $configStorage,
60+
#[Autowire(service: 'config.storage')]
61+
protected StorageInterface $configStorage,
6162
protected SiteAliasManagerInterface $siteAliasManager,
6263
protected StorageManagerInterface $configStorageExport,
6364
protected ImportStorageTransformer $importStorageTransformer,
6465
) {
6566
parent::__construct();
6667
}
6768

68-
public function getConfigStorageExport(): StorageManagerInterface|StorageCacheInterface
69-
{
70-
if (isset($this->configStorageExport)) {
71-
return $this->configStorageExport;
72-
}
73-
return $this->configStorage;
74-
}
75-
7669
public function hasImportTransformer(): bool
7770
{
7871
return isset($this->importStorageTransformer);

0 commit comments

Comments
 (0)