Skip to content

Commit

Permalink
Remove LoggerAwareTrait to resolve null error
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed May 23, 2021
1 parent bf5e10b commit 36431c2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Service/AuthService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit 36431c2

Please sign in to comment.