Skip to content

Commit e7e6216

Browse files
committed
Move config loading to initialize method
1 parent fa5084f commit e7e6216

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/PHPSemVerChecker/Console/Command/CompareCommand.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,22 @@ protected function configure()
4242
]);
4343
}
4444

45-
protected function execute(InputInterface $input, OutputInterface $output)
45+
protected function initialize(InputInterface $input, OutputInterface $output)
4646
{
47-
$startTime = microtime(true);
48-
47+
parent::initialize($input, $output);
4948
$configPath = $input->getOption('config');
5049
$this->config = $configPath ? Configuration::fromFile($configPath) : Configuration::defaults();
5150
$im = new InputMerger();
5251
$im->merge($input, $this->config);
5352

5453
// Set overrides
5554
LevelMapping::setOverrides($this->config->getLevelMapping());
55+
}
56+
57+
58+
protected function execute(InputInterface $input, OutputInterface $output)
59+
{
60+
$startTime = microtime(true);
5661

5762
$finder = new Finder();
5863
$scannerBefore = new Scanner();

0 commit comments

Comments
 (0)