private function ConfigSplitCliService::getSplitFromArgument in Configuration Split 2.0.x
Get the split from the argument.
Parameters
string $split: The split name.
object $io: The io object.
callable $t: The translation function.
Return value
\Drupal\Core\Config\ImmutableConfig|null The split config.
Throws
\InvalidArgumentException When there is no split argument.
5 calls to ConfigSplitCliService::getSplitFromArgument()
- ConfigSplitCliService::ioActivate in src/
ConfigSplitCliService.php - Handle the activation interaction.
- ConfigSplitCliService::ioDeactivate in src/
ConfigSplitCliService.php - Handle the deactivation interaction.
- ConfigSplitCliService::ioExport in src/
ConfigSplitCliService.php - Handle the export interaction.
- ConfigSplitCliService::ioImport in src/
ConfigSplitCliService.php - Handle the import interaction.
- ConfigSplitCliService::statusOverride in src/
ConfigSplitCliService.php - Get and set status config overrides.
File
- src/
ConfigSplitCliService.php, line 339
Class
- ConfigSplitCliService
- The CLI service class for interoperability.
Namespace
Drupal\config_splitCode
private function getSplitFromArgument(string $split, $io, callable $t) : ?ImmutableConfig {
if (!$split) {
throw new \InvalidArgumentException('Split can not be empty');
}
$config = $this->manager
->getSplitConfig($split);
if ($config === NULL) {
// Try to get the split from the sync storage. This may not make sense
// for all the operations.
$config = $this->manager
->getSplitConfig($split, $this->syncStorage);
if ($config === NULL) {
$io
->error($t('There is no split with name @name', [
'@name' => $split,
]));
}
}
return $config;
}