From 94616b0cddec33a36a275943cd735be77ec7044b Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Wed, 6 Mar 2024 18:35:13 +0100 Subject: [PATCH 1/2] Always call LogManager::channel() when registering logging --- src/LdapServiceProvider.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/LdapServiceProvider.php b/src/LdapServiceProvider.php index d0f2b99c..4f9169df 100644 --- a/src/LdapServiceProvider.php +++ b/src/LdapServiceProvider.php @@ -79,11 +79,9 @@ protected function registerLogging(): void return; } - Container::getInstance()->setLogger( - ($channel = Config::get('ldap.logging.channel')) - ? $logger->channel($channel) - : $logger - ); + $channelName = Config::get('ldap.logging.channel'); + $channel = $logger->channel($channelName); + Container::getInstance()->setLogger($channel); } /** From 8bd0610081a4502733c86945258888d68fe40b78 Mon Sep 17 00:00:00 2001 From: Steve Bauman Date: Wed, 6 Mar 2024 19:00:11 -0500 Subject: [PATCH 2/2] Small code style tweaks --- src/LdapServiceProvider.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/LdapServiceProvider.php b/src/LdapServiceProvider.php index 4f9169df..26cf2516 100644 --- a/src/LdapServiceProvider.php +++ b/src/LdapServiceProvider.php @@ -79,9 +79,11 @@ protected function registerLogging(): void return; } - $channelName = Config::get('ldap.logging.channel'); - $channel = $logger->channel($channelName); - Container::getInstance()->setLogger($channel); + Container::getInstance()->setLogger( + $logger->channel( + Config::get('ldap.logging.channel') + ) + ); } /**