Skip to content

Commit 59cd8f6

Browse files
committed
[TASK] Make compatible with symfony/console ^7
1 parent 951f18d commit 59cd8f6

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
"ext-json": "*",
1414
"helhum/config-loader": ">=0.12.4 <0.13",
1515
"helhum/typo3-console": "^8.0",
16-
"symfony/console": "^5.4 || ^6.1",
17-
"symfony/yaml": "^5.4 || ^6.1",
18-
"typo3/cms-composer-installers": "^4.0@rc || ^5.0",
16+
"symfony/console": "^5.4 || ^6.4 || ^7.0",
17+
"symfony/yaml": "^5.4 || ^6.4 || ^7.0",
18+
"typo3/cms-composer-installers": "^4.0@rc || >=5.0",
1919
"typo3/cms-core": "^11.5.20 || ^12.3",
2020
"composer-runtime-api": "^2.2",
2121
"symfony/polyfill-php80": "^1.23.1"

src/Command/EncryptSettingsCommand.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,21 @@ public function isEnabled(): bool
4242
return class_exists(Key::class);
4343
}
4444

45-
protected function execute(InputInterface $input, OutputInterface $output)
45+
protected function execute(InputInterface $input, OutputInterface $output): int
4646
{
4747
$io = new SymfonyStyle($input, $output);
4848
if (!$configFile = $input->getOption('config-file')) {
4949
$io->error('Please specify a config file');
5050

51-
return 1;
51+
return self::FAILURE;
5252
}
5353
$encryptionKey = $input->getOption('encryption-key');
5454
if (empty($encryptionKey)) {
5555
$generateKey = $io->confirm('No encryption key given. Should a new one be generated?', false);
5656
if (!$generateKey) {
5757
$io->error('No key given, cannot encrypt config file');
5858

59-
return 1;
59+
return self::FAILURE;
6060
}
6161
$encryptionKey = Key::createNewRandomKey()->saveToAsciiSafeString();
6262
$io->warning('Generated new encryption key');
@@ -79,13 +79,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
7979
if ($encryptedConfig === $originalConfig) {
8080
$io->warning(sprintf('No values found to encrypt in file "%s"', $input->getOption('config-file')));
8181

82-
return 1;
82+
return self::FAILURE;
8383
}
8484
$configDumper = new ConfigDumper();
8585
$configDumper->dumpToFile($encryptedConfig, $configFile);
8686

8787
$io->success(sprintf('Encrypted values in file "%s"', $input->getOption('config-file')));
8888

89-
return 0;
89+
return self::SUCCESS;
9090
}
9191
}

src/Command/ExtractSettingsCommand.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ protected function configure()
7878
->setHelp('Values from a previously existing LocalConfiguration.php are extracted and written to Yaml config files.');
7979
}
8080

81-
protected function execute(InputInterface $input, OutputInterface $output)
81+
protected function execute(InputInterface $input, OutputInterface $output): int
8282
{
8383
$systemSettingsFile = $this->configurationManager->getSystemConfigurationFileLocation();
8484
if ((new Typo3Version())->getMajorVersion() < 12) {
@@ -87,7 +87,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
8787
if ($this->isAutoGenerated($systemSettingsFile)) {
8888
$output->writeln('<info>LocalConfiguration.php does not exist or is auto generated. Nothing to extract.</info>');
8989

90-
return 0;
90+
return self::SUCCESS;
9191
}
9292
$configuration = require $systemSettingsFile;
9393

@@ -107,7 +107,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
107107
$configLoader = new ConfigLoader(true);
108108
$configLoader->flushCache();
109109

110-
return 0;
110+
return self::SUCCESS;
111111
}
112112

113113
private function isAutoGenerated(string $file): bool

0 commit comments

Comments
 (0)