Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit 16d4e03

Browse files
committed
🛀
1 parent f824592 commit 16d4e03

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

examples/oauth-example-common.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
HTTPClientAbstract, HTTPResponseInterface, TinyCurlClient
1515
};
1616
use chillerlan\Logger\{
17-
Log, LogOptions, LogOptionsTrait, LogTrait, Output\LogOutputAbstract
17+
Log, LogOptions, LogOptionsTrait, LogTrait, Output\LogOutputAbstract, Output\NullLogger
1818
};
1919
use chillerlan\OAuth\{
2020
OAuthOptions, Storage\SessionTokenStorage
@@ -23,7 +23,6 @@
2323
use chillerlan\Traits\{
2424
ContainerInterface, DotEnv
2525
};
26-
use Psr\Log\NullLogger;
2726

2827
ini_set('date.timezone', 'Europe/Amsterdam');
2928

@@ -64,6 +63,9 @@
6463
use DatabaseOptionsTrait, LogOptionsTrait;
6564
};
6665

66+
/** @var \Psr\Log\LoggerInterface $logger */
67+
$nullLogger = (new Log)->addInstance(new NullLogger($options), 'nullLog');
68+
6769
/** @var \Psr\Log\LoggerInterface $logger */
6870
$logger = (new Log)->addInstance(
6971
new class ($options) extends LogOutputAbstract{
@@ -104,12 +106,12 @@ public function request(string $url, array $params = null, string $method = null
104106

105107
};
106108

107-
$http->setLogger(new NullLogger);
109+
$http->setLogger($nullLogger);
108110

109111
/** @var \chillerlan\Database\Database $db */
110112
$db = new Database($options);
111-
$db->setLogger(new NullLogger);
113+
$db->setLogger($nullLogger);
112114

113115
/** @var \chillerlan\OAuth\Storage\TokenStorageInterface $storage */
114116
$storage = new SessionTokenStorage($options); //new DBTokenStorage($options, $db);
115-
$storage->setLogger(new NullLogger);
117+
$storage->setLogger($nullLogger);

0 commit comments

Comments
 (0)