Skip to content

Commit 04f4318

Browse files
committed
bug symfony#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 symfony#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
2 parents d6ad6a9 + 84ea4c8 commit 04f4318

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cookbook/console/commands_as_services.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ have some ``NameRepository`` service that you'll use to get your default value::
9090

9191
public function __construct(NameRepository $nameRepository)
9292
{
93-
parent::__construct();
94-
9593
$this->nameRepository = $nameRepository;
94+
95+
parent::__construct();
9696
}
9797

9898
protected function configure()

0 commit comments

Comments
 (0)