I encountered an error in the example04_images.php file due to the logger code implementation. The issue arose from a method signature mismatch with the Psr\Log\AbstractLogger. I have fixed the code by aligning the method signature with the expected parameters.
Changes Made:
Corrected the logger implementation to match the Psr\Log\AbstractLogger interface.
Ensured compatibility with PHP 8.2.12 by updating the method signature.
Fixed Code:
php
class CustomLogger extends \Psr\Log\AbstractLogger implements \Psr\Log\LoggerInterface
{
public function log($level, $message, array $context = []): void
{
echo $level . ': ' . $message . "\n";
}
}
Steps to Verify:
Run the example04_images.php file and ensure there are no errors.
Confirm the logger output displays the correct log messages.
I have pushed the updated code to the repository. Please review it.
I encountered an error in the example04_images.php file due to the logger code implementation. The issue arose from a method signature mismatch with the Psr\Log\AbstractLogger. I have fixed the code by aligning the method signature with the expected parameters.
Changes Made:
Fixed Code:
Steps to Verify:
I have pushed the updated code to the repository. Please review it.