Skip to content

Commit

Permalink
Fix autowiring (#915)
Browse files Browse the repository at this point in the history
  • Loading branch information
toooni authored Feb 10, 2020
1 parent a00f5a6 commit 04d452a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Command/AbstractIndexServiceAwareCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@

use ONGR\ElasticsearchBundle\DependencyInjection\Configuration;
use ONGR\ElasticsearchBundle\Service\IndexService;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\ContainerInterface;

abstract class AbstractIndexServiceAwareCommand extends Command
{
private $container;

const INDEX_OPTION = 'index';

public function __construct(Container $container)
public function __construct(ContainerInterface $container)
{
$this->container = $container;
parent::__construct();
Expand Down Expand Up @@ -58,7 +58,7 @@ protected function getIndex($name): IndexService
);
}

public function getContainer(): Container
public function getContainer(): ContainerInterface
{
return $this->container;
}
Expand Down
6 changes: 4 additions & 2 deletions Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ parameters:

services:

_defaults: { public: true }
_defaults:
public: true
autowire: true

ONGR\ElasticsearchBundle\Command\:
resource: '../../Command'
Expand Down Expand Up @@ -45,4 +47,4 @@ services:
ONGR\ElasticsearchBundle\EventListener\TerminateListener:
arguments: ["@service_container", "%ongr.esb.indexes%"]
tags:
- { name: kernel.event_listener, event: kernel.terminate }
- { name: kernel.event_listener, event: kernel.terminate }

0 comments on commit 04d452a

Please sign in to comment.