Skip to content

Commit dccac21

Browse files
committed
Check for the required class and not the kernel version
1 parent cb5189e commit dccac21

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

DependencyInjection/MonologExtension.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use Symfony\Component\DependencyInjection\Definition;
1919
use Symfony\Component\DependencyInjection\Reference;
2020
use Symfony\Component\DependencyInjection\ContainerInterface;
21-
use Symfony\Component\HttpKernel\Kernel;
2221

2322
/**
2423
* MonologExtension is an extension for the Monolog library.
@@ -127,8 +126,8 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler
127126
break;
128127

129128
case 'console':
130-
if (Kernel::VERSION_ID < 20400) {
131-
throw new \RuntimeException('The console handler requires Symfony 2.4+');
129+
if (!class_exists('Symfony\Bridge\Monolog\Handler\ConsoleHandler')) {
130+
throw new \RuntimeException('The console handler requires symfony/monolog-bridge 2.4+');
132131
}
133132

134133
$definition->setArguments(array(

0 commit comments

Comments
 (0)