Skip to content

Commit

Permalink
Don't change cs-fixer config rules when given
Browse files Browse the repository at this point in the history
  • Loading branch information
Korbeil committed Dec 7, 2019
1 parent 6bb1c14 commit eebe011
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/JsonSchema/Printer.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,17 @@ protected function fix(string $path): void
}

$command = new FixCommand(new ToolInfo());
$input = new ArrayInput([
$config = [
'path' => [$path],
'--allow-risky' => true,
'--rules' => $this->getDefaultRules(),
], $command->getDefinition());
];

if (!empty($this->fixerConfig)) {
$input->setOption('config', $this->fixerConfig);
$config['--config'] = $this->fixerConfig;
} else {
$config['--rules'] = $this->getDefaultRules();
}

$command->run($input, new NullOutput());
$command->run(new ArrayInput($config, $command->getDefinition()), new NullOutput());
}
}

0 comments on commit eebe011

Please sign in to comment.