Skip to content

Commit 981c211

Browse files
committed
bug #8849 Add constructor call to the "Getting Services from the Service Container" section (viion)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #8849). Discussion ---------- Add constructor call to the "Getting Services from the Service Container" section Parent constructor call is required when using auto-wired services in a command constructor, without it you will receive the error: ``` There are no commands defined in the "app" namespace. ``` Some discussion of what I ran into: #8843 Commits ------- 88fd7a7 Update console.rst
2 parents a5d47c6 + 88fd7a7 commit 981c211

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

console.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ as a service, you can use normal dependency injection. Imagine you have a
184184
public function __construct(UserManager $userManager)
185185
{
186186
$this->userManager = $userManager;
187+
188+
parent::__construct();
187189
}
188190

189191
// ...

0 commit comments

Comments
 (0)