From 795c0bd8a6d14d546a200c2c119cf93dc2a82137 Mon Sep 17 00:00:00 2001 From: core23 Date: Sun, 23 May 2021 23:14:59 +0200 Subject: [PATCH] Remove LoggerAwareTrait to resolve null error --- src/Service/AuthService.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Service/AuthService.php b/src/Service/AuthService.php index c07a178..4d76322 100644 --- a/src/Service/AuthService.php +++ b/src/Service/AuthService.php @@ -17,12 +17,15 @@ use Nucleos\LastFm\Session\Session; use Nucleos\LastFm\Session\SessionInterface; use Psr\Log\LoggerAwareInterface; -use Psr\Log\LoggerAwareTrait; +use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; final class AuthService implements LoggerAwareInterface, AuthServiceInterface { - use LoggerAwareTrait; + /** + * @var LoggerInterface + */ + private $logger; /** * @var string @@ -41,6 +44,11 @@ public function __construct(ApiClientInterface $connection, string $authUrl = 'h $this->logger = new NullLogger(); } + public function setLogger(LoggerInterface $logger): void + { + $this->logger = $logger; + } + public function createSession(string $token): ?SessionInterface { try {