Skip to content

Update LaravelHttpClientLoggerServiceProvider.php #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2025

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
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.

2 participants