Skip to content

Commit 8d3f6b4

Browse files
authored
[hotfix] unknown constants when executed with composer 2.2 (#25)
1 parent 14da8f0 commit 8d3f6b4

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Kununu/CsFixer/Command/CsFixerCommand.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
final class CsFixerCommand extends BaseCommand
1616
{
17+
public const int SUCCESS = 0;
18+
public const int FAILURE = 1;
19+
1720
private const string ARGUMENT_FILES = 'files';
1821
private const string OPTION_CONFIG = 'config';
1922
private const string OPTION_EXTRA_ARGS = 'extra-args';

Kununu/CsFixer/Command/CsFixerGitHookCommand.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
final class CsFixerGitHookCommand extends BaseCommand
1515
{
16+
public const int SUCCESS = 0;
17+
public const int FAILURE = 1;
18+
1619
protected function configure(): void
1720
{
1821
$this
@@ -42,11 +45,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
4245

4346
$io->success('PHP CS Fixer Git pre‑commit hook installed successfully.');
4447

45-
return 0;
48+
return self::SUCCESS;
4649
} catch (Throwable $e) {
4750
$io->error('Installation failed: ' . $e->getMessage());
4851

49-
return 1;
52+
return self::FAILURE;
5053
}
5154
}
5255

0 commit comments

Comments
 (0)