From c6bbd8814a054f76f312b52c4a9fe598a4458de7 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Mon, 6 Jan 2025 16:53:05 +1300 Subject: [PATCH] FIX Don't log to error handler (#670) --- src/ImageManipulation.php | 2 +- tests/php/ImageManipulationTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ImageManipulation.php b/src/ImageManipulation.php index a2827fc2..8f9e7491 100644 --- a/src/ImageManipulation.php +++ b/src/ImageManipulation.php @@ -725,7 +725,7 @@ public function Convert(string $toExtension): ?AssetContainer return $converter->convert($this, $toExtension); } catch (FileConverterException $e) { /** @var LoggerInterface $logger */ - $logger = Injector::inst()->get(LoggerInterface::class . '.errorhandler'); + $logger = Injector::inst()->get(LoggerInterface::class); $logger->error($e->getMessage()); return null; } diff --git a/tests/php/ImageManipulationTest.php b/tests/php/ImageManipulationTest.php index c872f113..9621fc90 100644 --- a/tests/php/ImageManipulationTest.php +++ b/tests/php/ImageManipulationTest.php @@ -595,7 +595,7 @@ public function testConvert(string $originalFileFixtureClass, string $originalFi $mockLogger = $this->getMockBuilder(Logger::class)->setConstructorArgs(['testLogger'])->getMock(); $mockLogger->expects($success ? $this->never() : $this->once()) ->method('error'); - Injector::inst()->registerService($mockLogger, LoggerInterface::class . '.errorhandler'); + Injector::inst()->registerService($mockLogger, LoggerInterface::class); $result = $file->Convert($toExtension);