55use PHPSemVerChecker \Analyzer \Analyzer ;
66use PHPSemVerChecker \Configuration \Configuration ;
77use PHPSemVerChecker \Configuration \LevelMapping ;
8- use PHPSemVerChecker \Console \InputMerger ;
98use PHPSemVerChecker \Filter \SourceFilter ;
109use PHPSemVerChecker \Finder \Finder ;
1110use PHPSemVerChecker \Reporter \JsonReporter ;
1211use PHPSemVerChecker \Reporter \Reporter ;
1312use PHPSemVerChecker \Scanner \ProgressScanner ;
1413use PHPSemVerChecker \Scanner \Scanner ;
15- use Symfony \Component \Console \Command \Command ;
1614use Symfony \Component \Console \Input \InputArgument ;
1715use Symfony \Component \Console \Input \InputInterface ;
1816use Symfony \Component \Console \Input \InputOption ;
1917use Symfony \Component \Console \Output \OutputInterface ;
2018
21- class CompareCommand extends Command {
22- /**
23- * @var \PHPSemVerChecker\Configuration\Configuration
24- */
25- protected $ config ;
26-
19+ class CompareCommand extends BaseCommand {
2720 protected function configure ()
2821 {
2922 $ this
@@ -32,32 +25,16 @@ protected function configure()
3225 ->setDefinition ([
3326 new InputArgument ('source-before ' , InputArgument::REQUIRED , 'A base directory to check (ex my-test) ' ),
3427 new InputArgument ('source-after ' , InputArgument::REQUIRED , 'A base directory to check against (ex my-test) ' ),
35- new InputOption ('include-before ' , null , InputOption::VALUE_OPTIONAL , 'List of paths to include <info>(comma separated)</info> ' ),
28+ new InputOption ('include-before ' , null , InputOption::VALUE_OPTIONAL , 'List of paths to include <info>(comma separated)</info> ' ),
3629 new InputOption ('include-after ' , null , InputOption::VALUE_OPTIONAL , 'List of paths to include <info>(comma separated)</info> ' ),
37- new InputOption ('exclude-before ' , null , InputOption::VALUE_REQUIRED , 'List of paths to exclude <info>(comma separated)</info> ' ),
30+ new InputOption ('exclude-before ' , null , InputOption::VALUE_REQUIRED , 'List of paths to exclude <info>(comma separated)</info> ' ),
3831 new InputOption ('exclude-after ' , null , InputOption::VALUE_REQUIRED , 'List of paths to exclude <info>(comma separated)</info> ' ),
3932 new InputOption ('full-path ' , null , InputOption::VALUE_NONE , 'Display the full path to the file instead of the relative path ' ),
4033 new InputOption ('config ' , null , InputOption::VALUE_REQUIRED , 'A configuration file to configure php-semver-checker ' ),
4134 new InputOption ('to-json ' , null , InputOption::VALUE_REQUIRED , 'Output the result to a JSON file ' )
4235 ]);
4336 }
4437
45- /**
46- * @param \Symfony\Component\Console\Input\InputInterface $input
47- * @param \Symfony\Component\Console\Output\OutputInterface $output
48- */
49- protected function initialize (InputInterface $ input , OutputInterface $ output )
50- {
51- parent ::initialize ($ input , $ output );
52- $ configPath = $ input ->getOption ('config ' );
53- $ this ->config = $ configPath ? Configuration::fromFile ($ configPath ) : Configuration::defaults ();
54- $ inputMerger = new InputMerger ();
55- $ inputMerger ->merge ($ input , $ this ->config );
56-
57- // Set overrides
58- LevelMapping::setOverrides ($ this ->config ->getLevelMapping ());
59- }
60-
6138 /**
6239 * @param \Symfony\Component\Console\Input\InputInterface $input
6340 * @param \Symfony\Component\Console\Output\OutputInterface $output
0 commit comments