Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • project/config_split
  • issue/config_split-3181828
  • issue/config_split-3182186
  • issue/config_split-3183010
  • issue/config_split-3181368
  • issue/config_split-2934170
  • issue/config_split-2967961
  • issue/config_split-3228508
  • issue/config_split-3231541
  • issue/config_split-3191356
  • issue/config_split-3232243
  • issue/config_split-3232667
  • issue/config_split-3236393
  • issue/config_split-3239366
  • issue/config_split-3239693
  • issue/config_split-3279331
  • issue/config_split-3240272
  • issue/config_split-3246688
  • issue/config_split-3246689
  • issue/config_split-3246696
  • issue/config_split-3238855
  • issue/config_split-3247757
  • issue/config_split-2938888
  • issue/config_split-3275363
  • issue/config_split-3276681
  • issue/config_split-3284552
  • issue/config_split-3293759
  • issue/config_split-3298501
  • issue/config_split-3309356
  • issue/config_split-3310931
  • issue/config_split-3328833
  • issue/config_split-3332194
  • issue/config_split-3325721
  • issue/config_split-3034589
  • issue/config_split-3273718
  • issue/config_split-3362191
  • issue/config_split-3298341
  • issue/config_split-3295853
  • issue/config_split-3386425
  • issue/config_split-3395243
  • issue/config_split-3396813
  • issue/config_split-3424108
  • issue/config_split-3426621
  • issue/config_split-3438245
  • issue/config_split-3428560
  • issue/config_split-3435910
  • issue/config_split-3432611
  • issue/config_split-3433305
  • issue/config_split-3479607
  • issue/config_split-3486027
  • issue/config_split-3492375
  • issue/config_split-3495075
  • issue/config_split-3390285
  • issue/config_split-3504053
  • issue/config_split-3505566
  • issue/config_split-3513818
  • issue/config_split-3514034
57 results
Show changes
Commits on Source (4)
Showing
with 70 additions and 63 deletions
...@@ -9,3 +9,4 @@ phplint ...@@ -9,3 +9,4 @@ phplint
Shortcutting Shortcutting
Stackable Stackable
stackable stackable
databasename
...@@ -5,6 +5,7 @@ entity.config_split.enable: ...@@ -5,6 +5,7 @@ entity.config_split.enable:
_controller: '\Drupal\config_split\Controller\ConfigSplitController::enableEntity' _controller: '\Drupal\config_split\Controller\ConfigSplitController::enableEntity'
requirements: requirements:
_permission: 'administer configuration split' _permission: 'administer configuration split'
_csrf_token: 'TRUE'
entity.config_split.disable: entity.config_split.disable:
path: '/admin/config/development/configuration/config-split/{config_split}/disable' path: '/admin/config/development/configuration/config-split/{config_split}/disable'
...@@ -12,6 +13,7 @@ entity.config_split.disable: ...@@ -12,6 +13,7 @@ entity.config_split.disable:
_controller: '\Drupal\config_split\Controller\ConfigSplitController::disableEntity' _controller: '\Drupal\config_split\Controller\ConfigSplitController::disableEntity'
requirements: requirements:
_permission: 'administer configuration split' _permission: 'administer configuration split'
_csrf_token: 'TRUE'
# Importing or activating the split writes the split config to the active one. # Importing or activating the split writes the split config to the active one.
entity.config_split.activate: entity.config_split.activate:
......
grumphp:
git_hook_variables:
EXEC_GRUMPHP_COMMAND: ['docker-compose', 'run', '--rm', '--no-deps', 'drupal']
ascii:
succeeded: ~
tasks:
phpcs: ~
phplint: ~
phpunit: ~
# phpstan: ~
...@@ -90,6 +90,8 @@ public function splitActivate($split) { ...@@ -90,6 +90,8 @@ public function splitActivate($split) {
* *
* @param string $split * @param string $split
* The split configuration to deactivate. * The split configuration to deactivate.
* @param array $options
* The options.
* *
* @command config-split:deactivate * @command config-split:deactivate
* *
...@@ -102,7 +104,7 @@ public function splitActivate($split) { ...@@ -102,7 +104,7 @@ public function splitActivate($split) {
* Propose an alias at: * Propose an alias at:
* https://www.drupal.org/project/config_split/issues/3181368 * https://www.drupal.org/project/config_split/issues/3181368
*/ */
public function splitDeactivate($split, $options = ['override' => FALSE]) { public function splitDeactivate($split, array $options = ['override' => FALSE]) {
return $this->cliService->ioDeactivate($split, $this->io(), 'dt', FALSE, $options['override']) ? DrushCommands::EXIT_SUCCESS : DrushCommands::EXIT_FAILURE; return $this->cliService->ioDeactivate($split, $this->io(), 'dt', FALSE, $options['override']) ? DrushCommands::EXIT_SUCCESS : DrushCommands::EXIT_FAILURE;
} }
......
...@@ -52,7 +52,7 @@ protected static function eventDispatcher() { ...@@ -52,7 +52,7 @@ protected static function eventDispatcher() {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function dispatch(object $event, string $eventName = NULL): object { public function dispatch(object $event, ?string $eventName = NULL): object {
// Do nothing, just return the event. // Do nothing, just return the event.
return $event; return $event;
} }
......
...@@ -47,7 +47,7 @@ public function __construct(StateInterface $state, CacheTagsInvalidatorInterface ...@@ -47,7 +47,7 @@ public function __construct(StateInterface $state, CacheTagsInvalidatorInterface
* @param bool|null $active * @param bool|null $active
* The state, null to reset. * The state, null to reset.
*/ */
public function setSplitOverride(string $name, bool $active = NULL) { public function setSplitOverride(string $name, ?bool $active = NULL) {
$name = self::fixName($name); $name = self::fixName($name);
$overrides = $this->state->get('config_split_override_state', []); $overrides = $this->state->get('config_split_override_state', []);
if ($active === NULL) { if ($active === NULL) {
......
...@@ -79,7 +79,7 @@ public function __construct( ...@@ -79,7 +79,7 @@ public function __construct(
ConfigSplitManager $manager, ConfigSplitManager $manager,
StorageInterface $activeStorage, StorageInterface $activeStorage,
StorageInterface $syncStorage, StorageInterface $syncStorage,
StatusOverride $statusOverride StatusOverride $statusOverride,
) { ) {
$this->manager = $manager; $this->manager = $manager;
$this->activeStorage = $activeStorage; $this->activeStorage = $activeStorage;
......
...@@ -108,7 +108,7 @@ public function __construct( ...@@ -108,7 +108,7 @@ public function __construct(
StorageInterface $sync, StorageInterface $sync,
StorageInterface $export, StorageInterface $export,
Connection $connection, Connection $connection,
ConfigPatchMerge $patchMerge ConfigPatchMerge $patchMerge,
) { ) {
$this->factory = $factory; $this->factory = $factory;
$this->sync = $sync; $this->sync = $sync;
...@@ -130,7 +130,7 @@ public function __construct( ...@@ -130,7 +130,7 @@ public function __construct(
* @return \Drupal\Core\Config\ImmutableConfig|null * @return \Drupal\Core\Config\ImmutableConfig|null
* The split config. * The split config.
*/ */
public function getSplitConfig(string $name, StorageInterface $storage = NULL): ?ImmutableConfig { public function getSplitConfig(string $name, ?StorageInterface $storage = NULL): ?ImmutableConfig {
if (strpos($name, 'config_split.config_split.') !== 0) { if (strpos($name, 'config_split.config_split.') !== 0) {
$name = 'config_split.config_split.' . $name; $name = 'config_split.config_split.' . $name;
} }
...@@ -181,7 +181,7 @@ public function getSplitEntity(string $name): ?ConfigSplitEntity { ...@@ -181,7 +181,7 @@ public function getSplitEntity(string $name): ?ConfigSplitEntity {
* @return string[] * @return string[]
* The split names from the active storage and the given storage. * The split names from the active storage and the given storage.
*/ */
public function listAll(StorageInterface $storage = NULL): array { public function listAll(?StorageInterface $storage = NULL): array {
$names = []; $names = [];
if ($storage instanceof StorageInterface && $this->factory instanceof ConfigFactory) { if ($storage instanceof StorageInterface && $this->factory instanceof ConfigFactory) {
$factory = EphemeralConfigFactory::fromService($this->factory, $storage); $factory = EphemeralConfigFactory::fromService($this->factory, $storage);
...@@ -202,7 +202,7 @@ public function listAll(StorageInterface $storage = NULL): array { ...@@ -202,7 +202,7 @@ public function listAll(StorageInterface $storage = NULL): array {
* @return \Drupal\Core\Config\ImmutableConfig[] * @return \Drupal\Core\Config\ImmutableConfig[]
* Loaded splits (with config overrides). * Loaded splits (with config overrides).
*/ */
public function loadMultiple(array $names, StorageInterface $storage = NULL): array { public function loadMultiple(array $names, ?StorageInterface $storage = NULL): array {
$configs = []; $configs = [];
if ($storage instanceof StorageInterface && $this->factory instanceof ConfigFactory) { if ($storage instanceof StorageInterface && $this->factory instanceof ConfigFactory) {
$factory = EphemeralConfigFactory::fromService($this->factory, $storage); $factory = EphemeralConfigFactory::fromService($this->factory, $storage);
...@@ -509,7 +509,7 @@ public function mergeSplit(ImmutableConfig $config, StorageInterface $transformi ...@@ -509,7 +509,7 @@ public function mergeSplit(ImmutableConfig $config, StorageInterface $transformi
* @return \Drupal\Core\Config\StorageInterface|null * @return \Drupal\Core\Config\StorageInterface|null
* The split storage. * The split storage.
*/ */
protected function getSplitStorage(ImmutableConfig $config, StorageInterface $transforming = NULL): ?StorageInterface { protected function getSplitStorage(ImmutableConfig $config, ?StorageInterface $transforming = NULL): ?StorageInterface {
$storage = $config->get('storage'); $storage = $config->get('storage');
if ('collection' === $storage) { if ('collection' === $storage) {
if ($transforming instanceof StorageInterface) { if ($transforming instanceof StorageInterface) {
...@@ -564,7 +564,7 @@ protected function getSplitStorage(ImmutableConfig $config, StorageInterface $tr ...@@ -564,7 +564,7 @@ protected function getSplitStorage(ImmutableConfig $config, StorageInterface $tr
* @return \Drupal\Core\Config\StorageInterface|null * @return \Drupal\Core\Config\StorageInterface|null
* The preview storage. * The preview storage.
*/ */
public function getPreviewStorage(ImmutableConfig $config, StorageInterface $transforming = NULL): ?StorageInterface { public function getPreviewStorage(ImmutableConfig $config, ?StorageInterface $transforming = NULL): ?StorageInterface {
if ('collection' === $config->get('storage')) { if ('collection' === $config->get('storage')) {
if ($transforming instanceof StorageInterface) { if ($transforming instanceof StorageInterface) {
return new SplitCollectionStorage($transforming, $config->get('id')); return new SplitCollectionStorage($transforming, $config->get('id'));
...@@ -975,6 +975,8 @@ protected static function inFilterList($name, array $list) { ...@@ -975,6 +975,8 @@ protected static function inFilterList($name, array $list) {
* *
* @param \Drupal\Core\Config\ImmutableConfig $config * @param \Drupal\Core\Config\ImmutableConfig $config
* The split config. * The split config.
* @param \Drupal\Core\Config\StorageInterface $source
* The source storage.
* *
* @return string[] * @return string[]
* The list of config names. * The list of config names.
...@@ -1002,15 +1004,15 @@ protected function calculateCompleteSplitList(ImmutableConfig $config, StorageIn ...@@ -1002,15 +1004,15 @@ protected function calculateCompleteSplitList(ImmutableConfig $config, StorageIn
$completeList = array_filter($source->listAll(), function ($name) use ($extensions, $completeList) { $completeList = array_filter($source->listAll(), function ($name) use ($extensions, $completeList) {
// Filter the list of config objects since they are not included in // Filter the list of config objects since they are not included in
// findConfigEntityDependents. // findConfigEntityDependents.
foreach ($extensions as $extension) { foreach ($extensions as $extension) {
if (strpos($name, $extension . '.') === 0) { if (strpos($name, $extension . '.') === 0) {
return TRUE; return TRUE;
}
} }
}
// Add the config name to the blacklist if it is in the wildcard list. // Add the config name to the blacklist if it is in the wildcard list.
return self::inFilterList($name, $completeList); return self::inFilterList($name, $completeList);
} }
); );
sort($completeList); sort($completeList);
// Finally merge all dependencies of the blacklisted config. // Finally merge all dependencies of the blacklisted config.
...@@ -1024,6 +1026,8 @@ protected function calculateCompleteSplitList(ImmutableConfig $config, StorageIn ...@@ -1024,6 +1026,8 @@ protected function calculateCompleteSplitList(ImmutableConfig $config, StorageIn
* *
* @param \Drupal\Core\Config\ImmutableConfig $config * @param \Drupal\Core\Config\ImmutableConfig $config
* The split config. * The split config.
* @param \Drupal\Core\Config\StorageInterface $source
* The source storage.
* *
* @return string[] * @return string[]
* The list of config names. * The list of config names.
...@@ -1039,7 +1043,7 @@ protected function calculateConditionalSplitList(ImmutableConfig $config, Storag ...@@ -1039,7 +1043,7 @@ protected function calculateConditionalSplitList(ImmutableConfig $config, Storag
$partialList = array_filter($source->listAll(), function ($name) use ($partialList) { $partialList = array_filter($source->listAll(), function ($name) use ($partialList) {
// Add to the partial list if it is in the wildcard list. // Add to the partial list if it is in the wildcard list.
return self::inFilterList($name, $partialList); return self::inFilterList($name, $partialList);
} }
); );
sort($partialList); sort($partialList);
......
...@@ -74,7 +74,7 @@ public function __construct( ...@@ -74,7 +74,7 @@ public function __construct(
EntityTypeManagerInterface $entityTypeManager, EntityTypeManagerInterface $entityTypeManager,
ConfigManagerInterface $configManager, ConfigManagerInterface $configManager,
DiffFormatter $diffFormatter, DiffFormatter $diffFormatter,
ConfigSplitManager $configSplitManager ConfigSplitManager $configSplitManager,
) { ) {
$this->activeStorage = $activeStorage; $this->activeStorage = $activeStorage;
$this->entityTypeManager = $entityTypeManager; $this->entityTypeManager = $entityTypeManager;
......
...@@ -120,7 +120,7 @@ public function __call($name, $arguments) { ...@@ -120,7 +120,7 @@ public function __call($name, $arguments) {
* @return \Drupal\Core\Config\ImmutableConfig[] * @return \Drupal\Core\Config\ImmutableConfig[]
* The default priority configs. * The default priority configs.
*/ */
protected function getDefaultPrioritySplitConfigs(StorageInterface $storage = NULL): array { protected function getDefaultPrioritySplitConfigs(?StorageInterface $storage = NULL): array {
$names = $this->manager->listAll($storage); $names = $this->manager->listAll($storage);
$explicit = Settings::get('config_split_priorities', []); $explicit = Settings::get('config_split_priorities', []);
if (is_array($explicit)) { if (is_array($explicit)) {
......
...@@ -56,7 +56,7 @@ trait ConfigImportFormTrait { ...@@ -56,7 +56,7 @@ trait ConfigImportFormTrait {
public function __construct( public function __construct(
StorageInterface $activeStorage, StorageInterface $activeStorage,
ConfigSplitManager $configSplitManager, ConfigSplitManager $configSplitManager,
StatusOverride $statusOverride StatusOverride $statusOverride,
) { ) {
$this->activeStorage = $activeStorage; $this->activeStorage = $activeStorage;
$this->manager = $configSplitManager; $this->manager = $configSplitManager;
...@@ -82,7 +82,7 @@ protected function buildFormWithStorageComparer( ...@@ -82,7 +82,7 @@ protected function buildFormWithStorageComparer(
FormStateInterface $form_state, FormStateInterface $form_state,
StorageComparer $storage_comparer, StorageComparer $storage_comparer,
array $options, array $options,
$validate = TRUE $validate = TRUE,
) { ) {
$form['actions'] = ['#type' => 'actions']; $form['actions'] = ['#type' => 'actions'];
$form['actions']['submit'] = [ $form['actions']['submit'] = [
...@@ -200,7 +200,7 @@ protected function buildFormWithStorageComparer( ...@@ -200,7 +200,7 @@ protected function buildFormWithStorageComparer(
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
protected function launchImport(StorageInterface $storage, string $override = NULL) { protected function launchImport(StorageInterface $storage, ?string $override = NULL) {
$comparer = new StorageComparer($storage, $this->activeStorage); $comparer = new StorageComparer($storage, $this->activeStorage);
$config_importer = $this->getConfigImporterFromComparer($comparer); $config_importer = $this->getConfigImporterFromComparer($comparer);
if ($config_importer->alreadyImporting()) { if ($config_importer->alreadyImporting()) {
......
...@@ -85,7 +85,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { ...@@ -85,7 +85,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
* @param \Drupal\Core\Session\AccountInterface $account * @param \Drupal\Core\Session\AccountInterface $account
* Run access checks for this account. * Run access checks for this account.
* @param string $config_split * @param string $config_split
* The split name form the route. * The split name form the route.
* *
* @return \Drupal\Core\Access\AccessResultInterface * @return \Drupal\Core\Access\AccessResultInterface
* The access result. * The access result.
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
use Drupal\config_split\Config\StatusOverride; use Drupal\config_split\Config\StatusOverride;
use Drupal\Core\Entity\EntityForm; use Drupal\Core\Entity\EntityForm;
use Drupal\Core\Extension\ThemeHandlerInterface; use Drupal\Core\Extension\ModuleExtensionList;
use Drupal\Core\Extension\ThemeExtensionList;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Site\Settings; use Drupal\Core\Site\Settings;
use Drupal\Core\State\StateInterface; use Drupal\Core\State\StateInterface;
...@@ -30,11 +31,18 @@ class ConfigSplitEntityForm extends EntityForm { ...@@ -30,11 +31,18 @@ class ConfigSplitEntityForm extends EntityForm {
protected $state; protected $state;
/** /**
* Drupal\Core\Extension\ThemeHandler definition. * The module list.
* *
* @var \Drupal\Core\Extension\ThemeHandlerInterface * @var \Drupal\Core\Extension\ModuleExtensionList
*/ */
protected $themeHandler; protected $moduleExtensionList;
/**
* The theme list.
*
* @var \Drupal\Core\Extension\ThemeExtensionList
*/
protected $themeExtensionList;
/** /**
* The entity being used by this form. * The entity being used by this form.
...@@ -50,17 +58,21 @@ class ConfigSplitEntityForm extends EntityForm { ...@@ -50,17 +58,21 @@ class ConfigSplitEntityForm extends EntityForm {
* The split status override service. * The split status override service.
* @param \Drupal\Core\State\StateInterface $state * @param \Drupal\Core\State\StateInterface $state
* The drupal state. * The drupal state.
* @param \Drupal\Core\Extension\ThemeHandlerInterface $themeHandler * @param \Drupal\Core\Extension\ModuleExtensionList $moduleExtensionList
* The theme handler. * The module list.
* @param \Drupal\Core\Extension\ThemeExtensionList $themeExtensionList
* The theme list.
*/ */
public function __construct( public function __construct(
StatusOverride $statusOverride, StatusOverride $statusOverride,
StateInterface $state, StateInterface $state,
ThemeHandlerInterface $themeHandler ModuleExtensionList $moduleExtensionList,
ThemeExtensionList $themeExtensionList,
) { ) {
$this->statusOverride = $statusOverride; $this->statusOverride = $statusOverride;
$this->state = $state; $this->state = $state;
$this->themeHandler = $themeHandler; $this->moduleExtensionList = $moduleExtensionList;
$this->themeExtensionList = $themeExtensionList;
} }
/** /**
...@@ -70,7 +82,8 @@ public static function create(ContainerInterface $container) { ...@@ -70,7 +82,8 @@ public static function create(ContainerInterface $container) {
return new static( return new static(
$container->get('config_split.status_override'), $container->get('config_split.status_override'),
$container->get('state'), $container->get('state'),
$container->get('theme_handler') $container->get('extension.list.module'),
$container->get('extension.list.theme'),
); );
} }
...@@ -184,10 +197,10 @@ public function form(array $form, FormStateInterface $form_state) { ...@@ -184,10 +197,10 @@ public function form(array $form, FormStateInterface $form_state) {
recorded in a config patch saved in in the split storage."), recorded in a config patch saved in in the split storage."),
]; ];
$module_handler = $this->moduleHandler; $module_handler = $this->moduleExtensionList;
$modules = array_map(function ($module) use ($module_handler) { $modules = array_map(function ($module) use ($module_handler) {
return $module_handler->getName($module->getName()); return $module_handler->getName($module->getName());
}, $module_handler->getModuleList()); }, $module_handler->getList());
// Add the existing ones with the machine name, so they do not get lost. // Add the existing ones with the machine name, so they do not get lost.
foreach (array_diff_key($config->get('module'), $modules) as $missing => $weight) { foreach (array_diff_key($config->get('module'), $modules) as $missing => $weight) {
$modules[$missing] = $missing; $modules[$missing] = $missing;
...@@ -214,10 +227,10 @@ public function form(array $form, FormStateInterface $form_state) { ...@@ -214,10 +227,10 @@ public function form(array $form, FormStateInterface $form_state) {
]; ];
// We should probably find a better way for this. // We should probably find a better way for this.
$theme_handler = $this->themeHandler; $theme_handler = $this->themeExtensionList;
$themes = array_map(function ($theme) use ($theme_handler) { $themes = array_map(function ($theme) use ($theme_handler) {
return $theme_handler->getName($theme->getName()); return $theme_handler->getName($theme->getName());
}, $theme_handler->listInfo()); }, $theme_handler->getList());
$form['complete_fieldset']['theme'] = [ $form['complete_fieldset']['theme'] = [
'#type' => $multiselect_type, '#type' => $multiselect_type,
'#title' => $this->t('Themes'), '#title' => $this->t('Themes'),
......
...@@ -56,7 +56,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { ...@@ -56,7 +56,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
* @param \Drupal\Core\Session\AccountInterface $account * @param \Drupal\Core\Session\AccountInterface $account
* Run access checks for this account. * Run access checks for this account.
* @param string $config_split * @param string $config_split
* The split name form the route. * The split name form the route.
* *
* @return \Drupal\Core\Access\AccessResultInterface * @return \Drupal\Core\Access\AccessResultInterface
* The access result. * The access result.
......
...@@ -68,7 +68,7 @@ protected function setUp(): void { ...@@ -68,7 +68,7 @@ protected function setUp(): void {
* @return string[][] * @return string[][]
* The different storage types. * The different storage types.
*/ */
public function storageAlternativesProvider(): array { public static function storageAlternativesProvider(): array {
return [['folder'], ['collection'], ['database']]; return [['folder'], ['collection'], ['database']];
} }
...@@ -266,8 +266,6 @@ public function testConditionalSplitWithModuleConfig($storage) { ...@@ -266,8 +266,6 @@ public function testConditionalSplitWithModuleConfig($storage) {
$expectedExport->write($name, $originalSystem); $expectedExport->write($name, $originalSystem);
} }
else { else {
// The option "skip equal" is false, write to both.
// $expectedSplit->write($name, $data);
$expectedExport->write($name, $data); $expectedExport->write($name, $data);
} }
} }
......
...@@ -52,7 +52,7 @@ protected function setUp(): void { ...@@ -52,7 +52,7 @@ protected function setUp(): void {
* *
* @dataProvider sequenceProvider * @dataProvider sequenceProvider
*/ */
public function testSequencePatch(string $name, array $configA, array $configB, ConfigPatch $expectedAB = NULL) { public function testSequencePatch(string $name, array $configA, array $configB, ?ConfigPatch $expectedAB = NULL) {
// Create patches in both directions. // Create patches in both directions.
$patchAB = $this->patchMerge->createPatch($configA, $configB, $name); $patchAB = $this->patchMerge->createPatch($configA, $configB, $name);
$patchBA = $this->patchMerge->createPatch($configB, $configA, $name); $patchBA = $this->patchMerge->createPatch($configB, $configA, $name);
...@@ -75,7 +75,7 @@ public function testSequencePatch(string $name, array $configA, array $configB, ...@@ -75,7 +75,7 @@ public function testSequencePatch(string $name, array $configA, array $configB,
/** /**
* Data provider for complex examples with a real schema. * Data provider for complex examples with a real schema.
*/ */
public function sequenceProvider() { public static function sequenceProvider() {
$a = [ $a = [
'nested' => [ 'nested' => [
[ [
...@@ -144,7 +144,6 @@ public function sequenceProvider() { ...@@ -144,7 +144,6 @@ public function sequenceProvider() {
], ],
]); ]);
// cSpell:enable // cSpell:enable
yield 'first test' => [ yield 'first test' => [
'name' => 'config_split_sequence_test.nested_sequences', 'name' => 'config_split_sequence_test.nested_sequences',
'configA' => $a, 'configA' => $a,
......
...@@ -107,7 +107,6 @@ public function testRoleSplit() { ...@@ -107,7 +107,6 @@ public function testRoleSplit() {
'removing' => [], 'removing' => [],
]); ]);
foreach (['test_role', 'test_role_empty'] as $id) { foreach (['test_role', 'test_role_empty'] as $id) {
// The patches look the same for all. // The patches look the same for all.
$patch = $storage->createCollection('split.test_split')->read('config_split.patch.user.role.' . $id); $patch = $storage->createCollection('split.test_split')->read('config_split.patch.user.role.' . $id);
...@@ -121,10 +120,10 @@ public function testRoleSplit() { ...@@ -121,10 +120,10 @@ public function testRoleSplit() {
} }
/** /**
* Test splitting a role into multiple "feature-splits" * Test splitting a role into multiple "feature-splits".
*/ */
public function testRoleMultiSplit() { public function testRoleMultiSplit() {
// We use shortcut and block to create the "feature-splits" // We use shortcut and block to create the "feature-splits".
$this->enableModules(['shortcut', 'block']); $this->enableModules(['shortcut', 'block']);
// Create a role with permissions from both modules. // Create a role with permissions from both modules.
...@@ -138,7 +137,6 @@ public function testRoleMultiSplit() { ...@@ -138,7 +137,6 @@ public function testRoleMultiSplit() {
]); ]);
$role->save(); $role->save();
// Create a split for the shortcut module. // Create a split for the shortcut module.
$this->createSplitConfig('feature_shortcut', [ $this->createSplitConfig('feature_shortcut', [
// We use the collection storage so that we can read the patch directly. // We use the collection storage so that we can read the patch directly.
...@@ -180,10 +178,9 @@ public function testRoleMultiSplit() { ...@@ -180,10 +178,9 @@ public function testRoleMultiSplit() {
'removing' => [], 'removing' => [],
]); ]);
foreach (['feature_shortcut', 'feature_block'] as $id) {
foreach (['feature_shortcut','feature_block'] as $id) {
// Check if the split actually has the expected configs. // Check if the split actually has the expected configs.
$patch = $storage->createCollection('split.'.$id)->read('config_split.patch.user.role.test_role'); $patch = $storage->createCollection('split.' . $id)->read('config_split.patch.user.role.test_role');
self::assertEquals($expectedPatches[$id]->toArray(), $patch); self::assertEquals($expectedPatches[$id]->toArray(), $patch);
} }
} }
......
...@@ -100,7 +100,7 @@ protected function setUp(): void { ...@@ -100,7 +100,7 @@ protected function setUp(): void {
* @return string[][] * @return string[][]
* The different storage types. * The different storage types.
*/ */
public function storageAlternativesProvider(): array { public static function storageAlternativesProvider(): array {
return [['folder'], ['collection'], ['database']]; return [['folder'], ['collection'], ['database']];
} }
......
...@@ -69,7 +69,7 @@ protected function setUp(): void { ...@@ -69,7 +69,7 @@ protected function setUp(): void {
* @return string[][] * @return string[][]
* The different storage types. * The different storage types.
*/ */
public function storageAlternativesProvider(): array { public static function storageAlternativesProvider(): array {
return [['folder'], ['collection'], ['database']]; return [['folder'], ['collection'], ['database']];
} }
......
...@@ -91,7 +91,7 @@ protected function getSplitSourceStorage(Config $config): StorageInterface { ...@@ -91,7 +91,7 @@ protected function getSplitSourceStorage(Config $config): StorageInterface {
* @return \Drupal\Core\Config\StorageInterface * @return \Drupal\Core\Config\StorageInterface
* The storage. * The storage.
*/ */
protected function getSplitPreviewStorage(Config $config, StorageInterface $export = NULL): StorageInterface { protected function getSplitPreviewStorage(Config $config, ?StorageInterface $export = NULL): StorageInterface {
if ('collection' === $config->get('storage')) { if ('collection' === $config->get('storage')) {
if ($export === NULL) { if ($export === NULL) {
throw new \InvalidArgumentException(); throw new \InvalidArgumentException();
...@@ -179,7 +179,8 @@ protected function validateImport(StorageInterface $storage): void { ...@@ -179,7 +179,8 @@ protected function validateImport(StorageInterface $storage): void {
$container->get('module_installer'), $container->get('module_installer'),
$container->get('theme_handler'), $container->get('theme_handler'),
$container->get('string_translation'), $container->get('string_translation'),
$container->get('extension.list.module') $container->get('extension.list.module'),
$container->get('extension.list.theme'),
); );
$importer->validate(); $importer->validate();
......