Permalink
Browse files

bug #3934 Move __construct after the repository assignment (cmodijk)

This PR was submitted for the 2.5 branch but it was merged into the 2.4 branch instead (closes #3934).

Discussion
----------

Move __construct after the repository assignment

The configure function is called from the parent::__construct(); so the $this->nameRepository is still empty during the configure. Thats why it should be the other way around.

Commits
-------

f06e49c Move __construct after the repository assignment
  • Loading branch information...
weaverryan committed Jun 11, 2014
2 parents d6ad6a9 + 84ea4c8 commit 04f43183dea62c1036c169392a81a353e516d8fe
Showing with 2 additions and 2 deletions.
  1. +2 −2 cookbook/console/commands_as_services.rst
@@ -90,9 +90,9 @@ have some ``NameRepository`` service that you'll use to get your default value::
public function __construct(NameRepository $nameRepository)
{
parent::__construct();
$this->nameRepository = $nameRepository;
parent::__construct();
}
protected function configure()

0 comments on commit 04f4318

Please sign in to comment.