php-http / client-common

Common HTTP Client implementations and tools for HTTPlug
http://httplug.io
MIT License
1.03k stars 54 forks source link

Fix implicit nullable type to avoid PHP 8.4 warnings #247

Closed eiriksm closed 2 months ago

eiriksm commented 2 months ago
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets fixes #X, partially #Y, mentioned in #Z
Documentation if this is a new feature, link to pull request in https://github.com/php-http/documentation that adds relevant documentation
License MIT

What's in this PR?

This PR makes the implicit nullable type explicit. Using implicit nullable types has been deprecated, and will emit deprecation warnings in PHP 8.4

Why?

To avoid getting deprecation warnings in PHP 8.4

Checklist

GrahamCampbell commented 2 months ago

Can we add PHP 8.4 to the CI, too?

eiriksm commented 2 months ago

Can we add PHP 8.4 to the CI, too?

done :nerd_face:

GrahamCampbell commented 2 months ago

Fixes similar to https://github.com/php-http/httplug/pull/176 are needed.

eiriksm commented 2 months ago

added the "emulate php 8.3" part, but not sure which tweak is needed to fix phpcs. Which by the way should probably be a separate PR, as it does not relate to the changes in this PR

GrahamCampbell commented 2 months ago

The tweak is needed to get it to pass, because the symfony ruleset has changed and the php-cs-fixer version is not pinned.

dbu commented 2 months ago

i updated the cs fixer and apply the fixes in #248. that includes the ? for nullable parameters.

can you please rebase on the 2.x branch? that should make the cs fixer green.

eiriksm commented 2 months ago

eiriksm commented 2 months ago

amazing. thank you so much for being so responsive :smile:

Any chance we could also cut a new release with this change? :nerd_face:

dbu commented 2 months ago

thanks for contributing. i tagged the release: https://github.com/php-http/client-common/releases/tag/2.7.2