Skip to content

Conversation

dpash
Copy link
Contributor

@dpash dpash commented May 8, 2025

Explicitly mark parameter $logger as nullable

Description

The parameter has a default value of null, but isn't explicitly marked as nullable, which causes a warning in PHP 8.4

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Any relevant logs, error output, etc?

[2025-05-08 08:21:38] local.WARNING: {closure:Bilfeldt\LaravelHttpClientLogger\LaravelHttpClientLoggerServiceProvider::packageBooted():62}(): Implicitly marking parameter $logger as nullable is deprecated, the explicit nullable type must be used instead in /var/www/html/vendor/bilfeldt/laravel-http-client-logger/src/LaravelHttpClientLoggerServiceProvider.php on line 62

Any other comments?

...

Checklist

  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Explicitly mark parameter $logger as nullable

The parameter has a default value of null, but isn't explicitly 
marked as nullable, which causes a warning in PHP 8.4
@dpash
Copy link
Contributor Author

dpash commented May 8, 2025

The failing tests appear to be due to PHPUnit. Laravel 9 tests pass using phpunit 9.6.23, but later versions of Laravel use PHPUnit 10 or 11.

@bilfeldt
Copy link
Owner

bilfeldt commented May 8, 2025

The failing test has nothing to do with this PR but because newer version of PHPUnit treats risky tests as failing. This should be solved separately.

@bilfeldt bilfeldt merged commit 363110f into bilfeldt:main May 8, 2025
9 of 25 checks passed
@tmannherz
Copy link

@bilfeldt Could you tag a new release that includes this change? Running PHP 8.4 on v2.4.0 of this package yields a lot of deprecation logging noise. Thanks!

@bilfeldt
Copy link
Owner

@bilfeldt Could you tag a new release that includes this change? Running PHP 8.4 on v2.4.0 of this package yields a lot of deprecation logging noise. Thanks!

Released in v2.4.1 https://github.com/bilfeldt/laravel-http-client-logger/releases/tag/v2.4.1

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.

3 participants