Skip to content

Commit

Permalink
Fix compatibility with Nette 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
enumag committed Apr 19, 2016
1 parent a3e7934 commit 0a1472c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Kdyby/Console/DI/ConsoleExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ public function loadConfiguration()
Nette\Utils\Validators::assert($config, 'array');
foreach ($config['commands'] as $i => $command) {
$def = $builder->addDefinition($this->prefix('command.' . $i));
list($def->factory) = Nette\DI\Compiler::filterArguments([
$def->setFactory(Nette\DI\Compiler::filterArguments([
is_string($command) ? new Statement($command) : $command
]);
])[0]);

if (class_exists($def->factory->entity)) {
$def->class = $def->factory->entity;
if (class_exists($def->getEntity())) {
$def->setClass($def->getEntity());
}

$def->setAutowired(FALSE);
Expand Down Expand Up @@ -127,11 +127,11 @@ protected function loadHelperSet(array $config)
$helpers[] = new Statement('Symfony\Component\Console\Helper\DialogHelper', [FALSE]);

foreach ($helpers as $helper) {
if (!class_exists($helper->entity)) {
if (!class_exists($helper->getEntity())) {
continue;
}

if (!self::hasConstructor($helper->entity)) {
if (!self::hasConstructor($helper->getEntity())) {
$helper->arguments = [];
}

Expand Down Expand Up @@ -167,7 +167,7 @@ public function beforeCompile()

$sfDispatcher = $builder->getByType('Symfony\Component\EventDispatcher\EventDispatcherInterface') ?: 'events.symfonyProxy';
if ($builder->hasDefinition($sfDispatcher)
&& $builder->getDefinition($sfDispatcher)->class === 'Symfony\Component\EventDispatcher\EventDispatcherInterface'
&& $builder->getDefinition($sfDispatcher)->getClass() === 'Symfony\Component\EventDispatcher\EventDispatcherInterface'
) {
$app->addSetup('setDispatcher');
}
Expand Down

0 comments on commit 0a1472c

Please sign in to comment.