Skip to content

Commit 428d21e

Browse files
authored
Fix autowiring (#913)
1 parent e1a6398 commit 428d21e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Command/AbstractIndexServiceAwareCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@
1313

1414
use ONGR\ElasticsearchBundle\DependencyInjection\Configuration;
1515
use ONGR\ElasticsearchBundle\Service\IndexService;
16-
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
1716
use Symfony\Component\Console\Command\Command;
1817
use Symfony\Component\Console\Input\InputOption;
1918
use Symfony\Component\DependencyInjection\Container;
19+
use Symfony\Component\DependencyInjection\ContainerInterface;
2020

2121
abstract class AbstractIndexServiceAwareCommand extends Command
2222
{
2323
private $container;
2424

2525
const INDEX_OPTION = 'index';
2626

27-
public function __construct(Container $container)
27+
public function __construct(ContainerInterface $container)
2828
{
2929
$this->container = $container;
3030
parent::__construct();
@@ -58,7 +58,7 @@ protected function getIndex($name): IndexService
5858
);
5959
}
6060

61-
public function getContainer(): Container
61+
public function getContainer(): ContainerInterface
6262
{
6363
return $this->container;
6464
}

Resources/config/services.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ parameters:
33

44
services:
55

6-
_defaults: { public: true }
6+
_defaults:
7+
public: true
8+
autowire: true
79

810
ONGR\ElasticsearchBundle\Command\:
911
resource: '../../Command'
@@ -45,4 +47,4 @@ services:
4547
ONGR\ElasticsearchBundle\EventListener\TerminateListener:
4648
arguments: ["@service_container", "%ongr.esb.indexes%"]
4749
tags:
48-
- { name: kernel.event_listener, event: kernel.terminate }
50+
- { name: kernel.event_listener, event: kernel.terminate }

0 commit comments

Comments
 (0)