@@ -72,8 +72,9 @@ protected function configureCli(): void {
7272 */
7373 final public function getContainer (): Container {
7474 if ($ this ->container === null ) {
75- $ this ->container = $ this ->createContainer ();
76- $ this ->configureContainer ();
75+ $ container = $ this ->createContainer ();
76+ $ this ->configureContainer ($ container );
77+ $ this ->container = $ container ;
7778 $ this ->container ->setInstance (Container::class, $ this ->container );
7879 }
7980 return $ this ->container ;
@@ -93,8 +94,10 @@ protected function createContainer(): Container {
9394
9495 /**
9596 * Configure the Container for usage.
97+ *
98+ * @param Container $container
9699 */
97- protected function configureContainer (): void {
100+ protected function configureContainer (Container $ container ): void {
98101 }
99102
100103 /**
@@ -233,7 +236,7 @@ public function addMethod(string $className, string $methodName, array $options
233236 $ this
234237 ->command ($ options [self ::OPT_COMMAND ])
235238 ->description ($ description )
236- ->meta (self ::META_ACTION , $ method -> getDeclaringClass () ->getName () . ':: ' . $ method ->getName ());
239+ ->meta (self ::META_ACTION , $ class ->getName () . ':: ' . $ method ->getName ());
237240 $ this ->addParams ($ method );
238241
239242 if ($ options [self ::OPT_SETTERS ]) {
@@ -258,7 +261,7 @@ public function addMethod(string $className, string $methodName, array $options
258261 * @param array $options Options to control the behavior of the mapping.
259262 * @return $this
260263 */
261- public function addCommandClass (string $ className , string $ methodName , array $ options = []): self {
264+ public function addCommandClass (string $ className , string $ methodName = ' run ' , array $ options = []): self {
262265 $ options += [
263266 self ::OPT_COMMAND => null ,
264267 self ::OPT_SETTERS => true ,
0 commit comments