Skip to content

Commit

Permalink
Allow config.storage service to be decorated (#6197)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpott authored Jan 7, 2025
1 parent 4a2db50 commit fe62841
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/Commands/config/ConfigCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand All @@ -57,22 +57,15 @@ 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,
) {
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);
Expand Down

0 comments on commit fe62841

Please sign in to comment.