Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace DummyLogger with the built-in psr/log NullLogger #96

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/PostNL.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

use DateTimeInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Log\NullLogger;
use Throwable;
use Firstred\PostNL\Entity\Barcode;
use Firstred\PostNL\Entity\Customer;
Expand Down Expand Up @@ -109,7 +110,6 @@
use Firstred\PostNL\Service\ShippingStatusServiceInterface;
use Firstred\PostNL\Service\TimeframeService;
use Firstred\PostNL\Service\TimeframeServiceInterface;
use Firstred\PostNL\Util\DummyLogger;
use Firstred\PostNL\Util\RFPdi;
use Firstred\PostNL\Util\Util;
use GuzzleHttp\ClientInterface as GuzzleClientInterface;
Expand Down Expand Up @@ -538,7 +538,7 @@ public function setLogger(LoggerInterface $logger): void
*/
public function resetLogger(): static
{
$this->logger = new DummyLogger();
$this->logger = new NullLogger();

return $this;
}
Expand Down
1 change: 1 addition & 0 deletions src/Util/DummyLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* Class DummyLogger.
*
* @internal
* @deprecated since 2.0.9. Use the NullLogger from psr/log instead.
*/
class DummyLogger implements LoggerInterface
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Misc/PostNLRestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
use Firstred\PostNL\Exception\InvalidArgumentException;
use Firstred\PostNL\HttpClient\MockHttpClient;
use Firstred\PostNL\PostNL;
use Firstred\PostNL\Util\DummyLogger;
use GuzzleHttp\Handler\MockHandler;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Psr7\Response;
use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\Framework\Error;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;

#[TestDox(text: 'The PostNL object')]
class PostNLRestTest extends TestCase
Expand Down Expand Up @@ -106,7 +106,7 @@ public function testSetNullLogger(): void
{
$this->postnl->resetLogger();

$this->assertInstanceOf(expected: DummyLogger::class, actual: $this->postnl->getLogger());
$this->assertInstanceOf(expected: NullLogger::class, actual: $this->postnl->getLogger());
}

/** @throws */
Expand Down
Loading