Skip to content

Commit 9667b1f

Browse files
committed
Fixed previous commit (CS)
1 parent 4fb28f7 commit 9667b1f

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Fixed psr-3 processing being applied to all handlers, only leaf ones are now processing
88
* Fixed regression when `app` channel is defined explicitly
99
* Fixed handlers marked as nested not being ignored properly from the stack
10-
* Added configuration support for Redis
10+
* Added support for Redis configuration
1111

1212
## 3.3.1 (2018-11-04)
1313

DependencyInjection/MonologExtension.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
use Monolog\Processor\ProcessorInterface;
1515
use Monolog\ResettableInterface;
16-
use Predis;
17-
use Redis;
1816
use Symfony\Bridge\Monolog\Handler\FingersCrossed\HttpCodeActivationStrategy;
1917
use Symfony\Bridge\Monolog\Processor\TokenProcessor;
2018
use Symfony\Bridge\Monolog\Processor\WebProcessor;
@@ -318,23 +316,23 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler
318316
if (isset($handler['redis']['id'])) {
319317
$clientId = $handler['redis']['id'];
320318
} elseif ('redis' === $handler['type']) {
321-
if (!class_exists(Redis::class)) {
319+
if (!class_exists(\Redis::class)) {
322320
throw new \RuntimeException('The \Redis class is not available.');
323321
}
324322

325-
$client = new Definition('\Redis');
323+
$client = new Definition(\Redis::class);
326324
$client->addMethodCall('connect', array($handler['redis']['host'], $handler['redis']['port']));
327325
$client->addMethodCall('auth', array($handler['redis']['password']));
328326
$client->addMethodCall('select', array($handler['redis']['database']));
329327
$client->setPublic(false);
330328
$clientId = uniqid('monolog.redis.client.', true);
331329
$container->setDefinition($clientId, $client);
332330
} else {
333-
if (!class_exists(Predis\Client::class)) {
331+
if (!class_exists(\Predis\Client::class)) {
334332
throw new \RuntimeException('The \Predis\Client class is not available.');
335333
}
336334

337-
$client = new Definition('\Predis\Client');
335+
$client = new Definition(\Predis\Client::class);
338336
$client->setArguments(array(
339337
$handler['redis']['host'],
340338
));

0 commit comments

Comments
 (0)