8
8
use Symfony \Component \Console \Input \InputInterface ;
9
9
use Symfony \Component \Console \Input \InputOption ;
10
10
use Symfony \Component \Console \Output \OutputInterface ;
11
+ use function is_bool ;
11
12
use function is_string ;
12
13
13
14
class ClearResultCacheCommand extends Command
@@ -34,6 +35,7 @@ protected function configure(): void
34
35
new InputOption ('autoload-file ' , 'a ' , InputOption::VALUE_REQUIRED , 'Project \'s additional autoload file path ' ),
35
36
new InputOption ('debug ' , null , InputOption::VALUE_NONE , 'Show debug information - which file is analysed, do not catch internal errors ' ),
36
37
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 ' ),
37
39
]);
38
40
}
39
41
@@ -55,11 +57,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
55
57
$ configuration = $ input ->getOption ('configuration ' );
56
58
$ memoryLimit = $ input ->getOption ('memory-limit ' );
57
59
$ debugEnabled = (bool ) $ input ->getOption ('debug ' );
60
+ $ allowXdebug = $ input ->getOption ('xdebug ' );
58
61
59
62
if (
60
63
(!is_string ($ autoloadFile ) && $ autoloadFile !== null )
61
64
|| (!is_string ($ configuration ) && $ configuration !== null )
62
65
|| (!is_string ($ memoryLimit ) && $ memoryLimit !== null )
66
+ || (!is_bool ($ allowXdebug ))
63
67
) {
64
68
throw new ShouldNotHappenException ();
65
69
}
@@ -75,7 +79,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
75
79
$ configuration ,
76
80
null ,
77
81
'0 ' ,
78
- false ,
82
+ $ allowXdebug ,
79
83
$ debugEnabled ,
80
84
);
81
85
} catch (InceptionNotSuccessfulException ) {
0 commit comments