Add Support for PHP 8.4
| Q | A |
|---|---|
| Documentation | yes/no |
| Bugfix | yes/no |
| BC Break | yes/no |
| New Feature | yes/no |
| RFC | yes/no |
| QA | yes/no |
Description
Seems like the PHP 8.4 pipeline is blocked by https://github.com/laminas/laminas-stdlib/pull/118
Yes and https://github.com/laminas/laminas-stdlib/pull/118 looks to be blocked due to https://github.com/vimeo/psalm/pull/10928
I added a comment https://github.com/laminas/laminas-stdlib/pull/118#issuecomment-2384861365 to confirm same. Lets hope dependent PRs get merged soon to unblock this.
@gsteel I am facing some issues while resolving one of the issue in https://github.com/laminas/laminas-code/blob/562e02b7d85cb9142b5116cc76c4c7c162a11a1c/test/Generator/TestAsset/ParameterClass.php#L78
Here, if we add ? before \stdClass $a = null then it'll resolve PHP 8.4 related issue but then test is giving deprecation Optional parameter $a declared before required parameter $b is implicitly treated as a required parameter.
Please suggest if we can keep mandatory parameter $b before optional parameter $a in this ? Or any other advise if not.
Please suggest if we can keep mandatory parameter $b before optional parameter $a in this ? Or any other advise if not.
$a is effectively mandatory because $b is and we don't support BC on named parameters, so the signature can be changed to fn(stdClass|null $a, $b) without breaking BC AFAIC. Alternatively, retain the = null and just suppress the CS issue.
Also, this is a Test asset - BC is not a concern.
default null value can be removed if next parameter is required, see
https://3v4l.org/4pQLN
that safe even extended, also, named argument is not used in the test :)
@samsonasik Please review and let me know if clarification or code modification required.
Sign off is needed, read https://github.com/laminas/laminas-code/pull/201/checks?check_run_id=32024385175
@gsteel PR changes are approved. Can you please check and merge this PR ?