55namespace Behastan \Command ;
66
77use Behastan \Analyzer \ClassMethodContextDefinitionsAnalyzer ;
8- use Behastan \DefinitionMasksResolver ;
98use Behastan \Finder \BehatMetafilesFinder ;
109use Behastan \UsedInstructionResolver ;
1110use Symfony \Component \Console \Command \Command ;
@@ -19,8 +18,6 @@ final class StatsCommand extends Command
1918{
2019 public function __construct (
2120 private readonly SymfonyStyle $ symfonyStyle ,
22- private readonly BehatMetafilesFinder $ behatMetafilesFinder ,
23- private readonly DefinitionMasksResolver $ definitionMasksResolver ,
2421 private readonly UsedInstructionResolver $ usedInstructionResolver ,
2522 private readonly ClassMethodContextDefinitionsAnalyzer $ classMethodContextDefinitionsAnalyzer ,
2623 ) {
@@ -45,25 +42,30 @@ protected function execute(InputInterface $input, OutputInterface $output): int
4542 $ testDirectories = (array ) $ input ->getArgument ('test-directory ' );
4643 Assert::allDirectory ($ testDirectories );
4744
48- $ featureFiles = $ this -> behatMetafilesFinder -> findFeatureFiles ($ testDirectories );
45+ $ featureFiles = BehatMetafilesFinder:: findFeatureFiles ($ testDirectories );
4946 if ($ featureFiles === []) {
5047 $ this ->symfonyStyle ->error ('No *.feature files found. Please provide correct test directory ' );
5148 return self ::FAILURE ;
5249 }
5350
54- $ contextFiles = $ this -> behatMetafilesFinder -> findContextFiles ($ testDirectories );
51+ $ contextFiles = BehatMetafilesFinder:: findContextFiles ($ testDirectories );
5552 if ($ contextFiles === []) {
5653 $ this ->symfonyStyle ->error ('No *Context.php files found. Please provide correct test directory ' );
5754 return self ::FAILURE ;
5855 }
5956
6057 $ this ->symfonyStyle ->title ('Usage stats for PHP definitions in *Feature files ' );
6158
62- // $maskCollection = $this->definitionMasksResolver->resolve($contextFiles);
6359 $ featureInstructions = $ this ->usedInstructionResolver ->resolveInstructionsFromFeatureFiles ($ featureFiles );
6460
6561 $ classMethodContextDefinitions = $ this ->classMethodContextDefinitionsAnalyzer ->resolve ($ contextFiles );
6662
63+ foreach ($ classMethodContextDefinitions as $ i => $ classMethodContextDefinition ) {
64+ $ section = sprintf ('%d) %s ' , $ i + 1 , $ classMethodContextDefinition ->getMask ());
65+ $ this ->symfonyStyle ->section ($ section );
66+ $ this ->symfonyStyle ->newLine ();
67+ }
68+
6769 dump (123 );
6870 die;
6971
0 commit comments