Skip to content

Conversation

fayzasalman
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant