Skip to content

Conversation

@MedSaidBenAli
Copy link

This pull request addresses a compatibility issue encountered with Magento 2.4.7-p2 where the NullLogger class in the 202ecommerce/bridge-sdk package does not implement the LoggerInterface methods with the correct type hints, leading to runtime errors.

Issue Details:

  • Steps to Reproduce:

    1. Install Magento 2.4.7-p2 with the Bridge SDK (202ecommerce/bridge-sdk).
    2. Attempt to log any message using the NullLogger class.
    3. Observe the error due to incorrect method signatures.
  • Expected Behavior:
    The NullLogger class should correctly implement the LoggerInterface methods with appropriate type hints for PHP 8.x compatibility.

  • Actual Behavior:
    The NullLogger class currently uses method signatures without proper type hints, causing runtime errors in PHP 8.x.

Fix:

  • Updated all NullLogger methods to include strict type hints, particularly for the $message parameter, which now accepts string|\Stringable.
  • All methods now explicitly return void to align with PHP 8.x best practices.

Impact:
This fix ensures that the NullLogger class in the Bridge SDK is fully compatible with PHP 8.x and resolves the runtime errors caused by incorrect method signatures.

…for message parameter


- Updated all logger methods in NullLogger to enforce strict typing for the `$message` parameter as `string|\Stringable`.
- Ensured that all methods now return `void` as part of the function signature.
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