From a2a7311c5c34bbc5a024416476d3d833b13c590c Mon Sep 17 00:00:00 2001 From: gerryvdm Date: Fri, 18 Apr 2014 17:26:07 +0200 Subject: [PATCH] Call parent::__construct() in code example The example code was not working. When overriding Command::__construct(), you need to call the parent instructor. --- cookbook/console/commands_as_services.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/cookbook/console/commands_as_services.rst b/cookbook/console/commands_as_services.rst index 09bfe12d77b..42c17700bba 100644 --- a/cookbook/console/commands_as_services.rst +++ b/cookbook/console/commands_as_services.rst @@ -91,6 +91,7 @@ have some ``NameRepository`` service that you'll use to get your default value:: public function __construct(NameRepository $nameRepository) { $this->nameRepository = $nameRepository; + parent::__construct(); } protected function configure()