@@ -53,12 +53,6 @@ protected function configure()
5353 InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL ,
5454 sprintf ('filter by a category (%s). ' , implode (', ' , self ::$ categories ))
5555 )
56- ->addOption (
57- 'with-service-id ' ,
58- null ,
59- InputOption::VALUE_NONE ,
60- 'also display service id '
61- )
6256 ->setDescription ('Display current GraphQL services (types, resolvers and mutations) ' );
6357 }
6458
@@ -72,53 +66,41 @@ protected function execute(InputInterface $input, OutputInterface $output)
7266 }
7367
7468 $ categories = empty ($ categoriesOption ) ? self ::$ categories : $ categoriesOption ;
75- $ withServiceId = $ input ->getOption ('with-service-id ' );
7669
7770 $ io = new SymfonyStyle ($ input , $ output );
7871 $ tableHeaders = ['solution id ' , 'aliases ' ];
79- if ($ withServiceId ) {
80- $ tableHeaders [] = 'service id ' ;
81- }
8272
8373 foreach ($ categories as $ category ) {
8474 $ io ->title (sprintf ('GraphQL %ss Services ' , ucfirst ($ category )));
8575
8676 /** @var FluentResolverInterface $resolver */
8777 $ resolver = $ this ->{$ category .'Resolver ' };
88- $ this ->renderTable ($ resolver , $ tableHeaders , $ io, $ withServiceId );
78+ $ this ->renderTable ($ resolver , $ tableHeaders , $ io );
8979 }
9080 }
9181
9282 /**
9383 * @param FluentResolverInterface $resolver
9484 * @param array $tableHeaders
9585 * @param SymfonyStyle $io
96- * @param bool $withServiceId
9786 */
98- private function renderTable (FluentResolverInterface $ resolver , array $ tableHeaders , SymfonyStyle $ io, $ withServiceId )
87+ private function renderTable (FluentResolverInterface $ resolver , array $ tableHeaders , SymfonyStyle $ io )
9988 {
10089 $ tableRows = [];
10190 $ solutionIDs = array_keys ($ resolver ->getSolutions ());
10291 sort ($ solutionIDs );
10392 foreach ($ solutionIDs as $ solutionID ) {
10493 $ aliases = $ resolver ->getSolutionAliases ($ solutionID );
105- $ options = $ resolver ->getSolutionOptions ($ solutionID );
106- $ tableRows [$ solutionID ] = [$ solutionID , self ::serializeAliases ($ aliases , $ options )];
107- if ($ withServiceId ) {
108- $ tableRows [$ solutionID ][] = $ options ['id ' ];
109- }
94+ $ tableRows [$ solutionID ] = [$ solutionID , self ::serializeAliases ($ aliases )];
11095 }
11196 ksort ($ tableRows );
11297 $ io ->table ($ tableHeaders , $ tableRows );
11398 $ io ->write ("\n\n" );
11499 }
115100
116- private static function serializeAliases (array $ aliases, array $ options )
101+ private static function serializeAliases (array $ aliases )
117102 {
118103 ksort ($ aliases );
119- $ aliases = array_map (function ($ alias ) use ($ options ) {
120- return $ alias .(isset ($ options ['method ' ]) ? ' (method: ' .$ options ['method ' ].') ' : '' );
121- }, $ aliases );
122104
123105 return implode ("\n" , $ aliases );
124106 }
0 commit comments