Skip to content

Commit

Permalink
Merge pull request #270 from tienvx/no-need-to-define-any-reporter-pl…
Browse files Browse the repository at this point in the history
…ugin

No need to define any reporter plugin
  • Loading branch information
tienvx committed Jun 6, 2019
2 parents ae424c2 + e979ea5 commit bfa3af4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/DependencyInjection/Compiler/ReporterPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Exception;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Exception\RuntimeException;

class ReporterPass implements CompilerPassInterface
{
Expand All @@ -31,9 +30,7 @@ public function process(ContainerBuilder $container)
return;
}

if (!$reporters = $this->findTaggedServices($container, $this->reporterTag)) {
throw new RuntimeException(sprintf('You must tag at least one service as "%s" to use the "%s" service.', $this->reporterTag, $this->reporterService));
}
$reporters = $this->findTaggedServices($container, $this->reporterTag);

$reporterDefinition = $container->getDefinition($this->reporterService);
$reporterDefinition->replaceArgument(0, $reporters);
Expand Down

0 comments on commit bfa3af4

Please sign in to comment.