Skip to content

Commit a1564e2

Browse files
committed
minor #10219 [Console] Replace useless usage of ContainerAwareCommand (gregurco)
This PR was merged into the 4.1 branch. Discussion ---------- [Console] Replace useless usage of ContainerAwareCommand Hello. Since SF 4.0 there is no need to use `ContainerAwareCommand` and injection through constructor. I removed usage of `ContainerAwareCommand` and added call of parent `constructor` because there is an error without it: ``` [WARNING] Some commands could not be registered: Command class "App\Command\CommandName" is not correctly initialized. You probably forgot to call the parent constructor. ``` Commits ------- 0d1696c [Console] Replace useless usage of ContainerAwareCommand
2 parents dffddaa + 0d1696c commit a1564e2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

console/request_context.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,14 @@ router service and override its settings::
7878
use Symfony\Component\Routing\RouterInterface;
7979
// ...
8080

81-
class DemoCommand extends ContainerAwareCommand
81+
class DemoCommand extends Command
8282
{
8383
private $router;
8484

8585
public function __construct(RouterInterface $router)
8686
{
87+
parent::__construct();
88+
8789
$this->router = $router;
8890
}
8991

0 commit comments

Comments
 (0)