@@ -88,7 +88,6 @@ protected function configure()
88
88
protected function execute (InputInterface $ input , OutputInterface $ output )
89
89
{
90
90
$ this ->ioStyle = new SymfonyStyle ($ input , $ output );
91
- $ this ->parseRulesetJson ();
92
91
try {
93
92
$ this ->validateInput ($ input );
94
93
} catch (InvalidArgumentException $ e ) {
@@ -141,8 +140,9 @@ private function validateInput(InputInterface $input)
141
140
$ this ->staticCheckObjects = [];
142
141
$ requiredChecksNames = $ input ->getArgument ('names ' );
143
142
// Build list of static check names to run.
144
- if (empty ($ requiredChecksNames ) && isset ($ this ->ruleSet ['tests ' ])) {
145
- $ requiredChecksNames = $ this ->ruleSet ['tests ' ];
143
+ if (empty ($ requiredChecksNames )) {
144
+ $ this ->parseRulesetJson ();
145
+ $ requiredChecksNames = $ this ->ruleSet ['tests ' ] ?? null ;
146
146
}
147
147
if (empty ($ requiredChecksNames )) {
148
148
$ this ->staticCheckObjects = $ this ->allStaticCheckObjects ;
@@ -192,7 +192,7 @@ private function validateTestNames($requiredChecksNames)
192
192
private function parseRulesetJson ()
193
193
{
194
194
$ pathToRuleset = TESTS_BP . DIRECTORY_SEPARATOR . "staticRuleset.json " ;
195
- if ($ pathToRuleset === null ) {
195
+ if (! file_exists ( $ pathToRuleset) ) {
196
196
$ this ->ioStyle ->text ("No ruleset under $ pathToRuleset " . PHP_EOL );
197
197
return ;
198
198
}
0 commit comments