@@ -51,17 +51,17 @@ class MetaCommand extends Command
5151 protected $ config ;
5252
5353 protected $ methods = [
54- 'new \Illuminate\Contracts\Container\Container ' ,
55- '\Illuminate\Container\Container::makeWith(0) ' ,
56- '\Illuminate\Contracts\Container\Container::get(0) ' ,
57- '\Illuminate\Contracts\Container\Container::make(0) ' ,
58- '\Illuminate\Contracts\Container\Container::makeWith(0) ' ,
59- '\App::get(0) ' ,
60- '\App::make(0) ' ,
61- '\App::makeWith(0) ' ,
62- '\app(0) ' ,
63- '\resolve(0) ' ,
64- '\Psr\Container\ContainerInterface::get(0) ' ,
54+ 'new \Illuminate\Contracts\Container\Container ' ,
55+ '\Illuminate\Container\Container::makeWith(0) ' ,
56+ '\Illuminate\Contracts\Container\Container::get(0) ' ,
57+ '\Illuminate\Contracts\Container\Container::make(0) ' ,
58+ '\Illuminate\Contracts\Container\Container::makeWith(0) ' ,
59+ '\App::get(0) ' ,
60+ '\App::make(0) ' ,
61+ '\App::makeWith(0) ' ,
62+ '\app(0) ' ,
63+ '\resolve(0) ' ,
64+ '\Psr\Container\ContainerInterface::get(0) ' ,
6565 ];
6666
6767 /**
@@ -108,7 +108,7 @@ public function handle()
108108 }
109109
110110 $ reflectionClass = new \ReflectionClass ($ concrete );
111- if (is_object ($ concrete ) && !$ reflectionClass ->isAnonymous ()) {
111+ if (is_object ($ concrete ) && !$ reflectionClass ->isAnonymous () && $ abstract !== get_class ( $ concrete ) ) {
112112 $ bindings [$ abstract ] = get_class ($ concrete );
113113 }
114114 } catch (\Throwable $ e ) {
@@ -121,9 +121,10 @@ public function handle()
121121 $ this ->unregisterClassAutoloadExceptions ($ ourAutoloader );
122122
123123 $ content = $ this ->view ->make ('meta ' , [
124- 'bindings ' => $ bindings ,
125- 'methods ' => $ this ->methods ,
126- 'factories ' => $ factories ,
124+ 'bindings ' => $ bindings ,
125+ 'methods ' => $ this ->methods ,
126+ 'factories ' => $ factories ,
127+ 'expectedArguments ' => $ this ->getExpectedArguments ()
127128 ])->render ();
128129
129130 $ filename = $ this ->option ('filename ' );
@@ -167,6 +168,20 @@ protected function registerClassAutoloadExceptions(): callable
167168 return $ autoloader ;
168169 }
169170
171+ protected function getExpectedArguments ()
172+ {
173+ return [
174+ 'config ' => [
175+ 0 => $ this ->getConfigHints ()
176+ ]
177+ ];
178+ }
179+
180+ protected function getConfigHints ()
181+ {
182+ return collect ($ this ->config ->all ())->dot ()->keys ()->toArray ();
183+ }
184+
170185 /**
171186 * Get the console command options.
172187 *
0 commit comments