@@ -53,12 +53,6 @@ protected function configure()
53
53
InputOption::VALUE_IS_ARRAY | InputOption::VALUE_OPTIONAL ,
54
54
sprintf ('filter by a category (%s). ' , implode (', ' , self ::$ categories ))
55
55
)
56
- ->addOption (
57
- 'with-service-id ' ,
58
- null ,
59
- InputOption::VALUE_NONE ,
60
- 'also display service id '
61
- )
62
56
->setDescription ('Display current GraphQL services (types, resolvers and mutations) ' );
63
57
}
64
58
@@ -72,53 +66,41 @@ protected function execute(InputInterface $input, OutputInterface $output)
72
66
}
73
67
74
68
$ categories = empty ($ categoriesOption ) ? self ::$ categories : $ categoriesOption ;
75
- $ withServiceId = $ input ->getOption ('with-service-id ' );
76
69
77
70
$ io = new SymfonyStyle ($ input , $ output );
78
71
$ tableHeaders = ['solution id ' , 'aliases ' ];
79
- if ($ withServiceId ) {
80
- $ tableHeaders [] = 'service id ' ;
81
- }
82
72
83
73
foreach ($ categories as $ category ) {
84
74
$ io ->title (sprintf ('GraphQL %ss Services ' , ucfirst ($ category )));
85
75
86
76
/** @var FluentResolverInterface $resolver */
87
77
$ resolver = $ this ->{$ category .'Resolver ' };
88
- $ this ->renderTable ($ resolver , $ tableHeaders , $ io, $ withServiceId );
78
+ $ this ->renderTable ($ resolver , $ tableHeaders , $ io );
89
79
}
90
80
}
91
81
92
82
/**
93
83
* @param FluentResolverInterface $resolver
94
84
* @param array $tableHeaders
95
85
* @param SymfonyStyle $io
96
- * @param bool $withServiceId
97
86
*/
98
- private function renderTable (FluentResolverInterface $ resolver , array $ tableHeaders , SymfonyStyle $ io, $ withServiceId )
87
+ private function renderTable (FluentResolverInterface $ resolver , array $ tableHeaders , SymfonyStyle $ io )
99
88
{
100
89
$ tableRows = [];
101
90
$ solutionIDs = array_keys ($ resolver ->getSolutions ());
102
91
sort ($ solutionIDs );
103
92
foreach ($ solutionIDs as $ solutionID ) {
104
93
$ 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 )];
110
95
}
111
96
ksort ($ tableRows );
112
97
$ io ->table ($ tableHeaders , $ tableRows );
113
98
$ io ->write ("\n\n" );
114
99
}
115
100
116
- private static function serializeAliases (array $ aliases, array $ options )
101
+ private static function serializeAliases (array $ aliases )
117
102
{
118
103
ksort ($ aliases );
119
- $ aliases = array_map (function ($ alias ) use ($ options ) {
120
- return $ alias .(isset ($ options ['method ' ]) ? ' (method: ' .$ options ['method ' ].') ' : '' );
121
- }, $ aliases );
122
104
123
105
return implode ("\n" , $ aliases );
124
106
}
0 commit comments