Skip to content

Commit 3befb53

Browse files
committed
ClearResultCacheCommand - --xdebug option
1 parent 7dd5f1b commit 3befb53

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Command/ClearResultCacheCommand.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Symfony\Component\Console\Input\InputInterface;
99
use Symfony\Component\Console\Input\InputOption;
1010
use Symfony\Component\Console\Output\OutputInterface;
11+
use function is_bool;
1112
use function is_string;
1213

1314
class ClearResultCacheCommand extends Command
@@ -34,6 +35,7 @@ protected function configure(): void
3435
new InputOption('autoload-file', 'a', InputOption::VALUE_REQUIRED, 'Project\'s additional autoload file path'),
3536
new InputOption('debug', null, InputOption::VALUE_NONE, 'Show debug information - which file is analysed, do not catch internal errors'),
3637
new InputOption('memory-limit', null, InputOption::VALUE_REQUIRED, 'Memory limit for clearing result cache'),
38+
new InputOption('xdebug', null, InputOption::VALUE_NONE, 'Allow running with XDebug for debugging purposes'),
3739
]);
3840
}
3941

@@ -55,11 +57,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5557
$configuration = $input->getOption('configuration');
5658
$memoryLimit = $input->getOption('memory-limit');
5759
$debugEnabled = (bool) $input->getOption('debug');
60+
$allowXdebug = $input->getOption('xdebug');
5861

5962
if (
6063
(!is_string($autoloadFile) && $autoloadFile !== null)
6164
|| (!is_string($configuration) && $configuration !== null)
6265
|| (!is_string($memoryLimit) && $memoryLimit !== null)
66+
|| (!is_bool($allowXdebug))
6367
) {
6468
throw new ShouldNotHappenException();
6569
}
@@ -75,7 +79,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7579
$configuration,
7680
null,
7781
'0',
78-
false,
82+
$allowXdebug,
7983
$debugEnabled,
8084
);
8185
} catch (InceptionNotSuccessfulException) {

0 commit comments

Comments
 (0)