Skip to content

Commit

Permalink
bug #3934 Move __construct after the repository assignment (cmodijk)
Browse files Browse the repository at this point in the history
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 04f4318
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cookbook/console/commands_as_services.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 04f4318

Please sign in to comment.