Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
Must get reference, not definition directly.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephpy committed Feb 23, 2017
1 parent 8eff6e4 commit ff9c3e7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions DependencyInjection/SpyTimelineExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ public function load(array $configs, ContainerBuilder $container)

// result builder
$definition = $container->getDefinition('spy_timeline.result_builder');
$definition->addArgument($container->getDefinition(sprintf('spy_timeline.query_executor.%s', $driver)));
$definition->addArgument(new Reference(sprintf('spy_timeline.query_executor.%s', $driver)));
$definition->addArgument($filterManager);

if ($paginator) {
$definition->addMethodCall('setPager', array($container->getDefinition($paginator)));
$definition->addMethodCall('setPager', array(new Reference($paginator)));
}

// spreads
Expand All @@ -105,7 +105,7 @@ public function load(array $configs, ContainerBuilder $container)

// notifiers
$notifiers = $config['notifiers'];
$definition = $container->getDefinition($config['spread']['deployer']);
$definition = new Reference($config['spread']['deployer']);

This comment has been minimized.

Copy link
@pppdns

pppdns Apr 18, 2017

Contributor

because of this change $definition->addMethodCall(...) on L111 results in Fatal error: Call to undefined method Symfony\Component\DependencyInjection\Reference::addMethodCall(). This is because after this change $definition is Reference type, though it should be Definition type which has the addMethodCall method

This comment has been minimized.

Copy link
@stephpy

stephpy May 16, 2017

Author Owner

My bad .. :\


foreach ($notifiers as $notifier) {
$definition->addMethodCall('addNotifier', array(new Reference($notifier)));
Expand Down

0 comments on commit ff9c3e7

Please sign in to comment.