88use Symfony \Component \Console \Input \InputInterface ;
99use Symfony \Component \Console \Input \InputOption ;
1010use Symfony \Component \Console \Output \OutputInterface ;
11+ use function is_bool ;
1112use function is_string ;
1213
1314class 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