Skip to content

Commit 4a96312

Browse files
author
Francois Suter
committed
[TASK] Use Symfony command return values
1 parent eeeb6bd commit 4a96312

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

Classes/Command/FlushLanguageCacheCommand.php

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
namespace Cobweb\FlushLanguageCache\Command;
@@ -30,18 +31,16 @@
3031
*/
3132
class FlushLanguageCacheCommand extends Command
3233
{
33-
public const SUCCESS = 0;
34-
public const FAILURE = 1;
3534

3635
/**
3736
* Configures the command by setting its name, description and options.
3837
*
3938
* @return void
4039
*/
41-
public function configure()
40+
public function configure(): void
4241
{
4342
$this->setDescription('Clears the language cache (l10n).')
44-
->setHelp('Just run the command and the whole language cache will be cleared.');
43+
->setHelp('Just run the command and the whole language cache will be cleared.');
4544
}
4645

4746
/**
@@ -61,17 +60,16 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6160

6261
$io->success('Done clearing the language cache (l10n).');
6362
$io->note('If you still don\'t see what you want, you may want to update the TYPO3 language packs.');
64-
return static::SUCCESS;
63+
return Command::SUCCESS;
6564
} catch (\Exception $e) {
6665
$io->error(
67-
sprintf(
68-
'Failed to clear the language cache (l10n). Error: %s (%d)',
69-
$e->getMessage(),
70-
$e->getCode()
71-
)
66+
sprintf(
67+
'Failed to clear the language cache (l10n). Error: %s (%d)',
68+
$e->getMessage(),
69+
$e->getCode()
70+
)
7271
);
73-
return static::FAILURE;
72+
return Command::FAILURE;
7473
}
75-
7674
}
7775
}

0 commit comments

Comments
 (0)