From 00e1ea83631bece40e5469b505e7f2d3f6f0ee5e Mon Sep 17 00:00:00 2001 From: Oleg Voronkovich Date: Thu, 3 Jan 2019 19:43:29 +0300 Subject: [PATCH] Fix incompatibility with Symfony 4 --- Command/PopulateCommand.php | 10 ++++++++-- Resources/config/services.xml | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Command/PopulateCommand.php b/Command/PopulateCommand.php index 026465b..0f0d3a9 100644 --- a/Command/PopulateCommand.php +++ b/Command/PopulateCommand.php @@ -19,6 +19,13 @@ */ class PopulateCommand extends ContainerAwareCommand { + private $populator; + + public function setPopulator($populator) + { + $this->populator = $populator; + } + /** * {@inheritDoc} */ @@ -41,8 +48,7 @@ protected function configure() */ protected function execute(InputInterface $input, OutputInterface $output) { - $populator = $this->getContainer()->get('faker.populator'); - $insertedPks = $populator->execute(); + $insertedPks = $this->populator->execute(); $output->writeln(''); diff --git a/Resources/config/services.xml b/Resources/config/services.xml index f03529b..c9dab70 100644 --- a/Resources/config/services.xml +++ b/Resources/config/services.xml @@ -27,6 +27,9 @@ + + +