-
Notifications
You must be signed in to change notification settings - Fork 14
Fix main PHPSpec and PHP 8.4 compatibility: Wrap service container arrays in objects #64
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
Conversation
shulard
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @balazscsaba2006 for this PR. Some tiny questions in this review 😄.
|
Hello @balazscsaba2006 ! I've pushed some changes in #65 to fix issues with the GitHub workflows. Can you rebase your changes ? If you don't know how to do it I can help 😄. |
Nice! I have rebased the PR. |
|
Looks like there are some issues in the CI, can you try to run the following commands locally on your code: composer run analyse
composer run lint
composer run testThis way you'll check the code structure and the tests. Let me know if you have strange issues 😉 |
|
@shulard I fixed the spec tests now, sorry about that. |
No worries, thank you for the change. I still get issues in the CI about PHPStan like this: Can you check those too ? |
|
I get no error with the analyze command, I'm guessing it's due to the version of the |
|
@shulard I had to ignore the PHPStan issue, since it's not valid in case |
|
@shulard https://github.com/friends-of-phpspec/phpspec-code-coverage/actions/runs/16315004454/job/46078986656?pr=64 is failing, and I don't have the permission to re-run it. Can you help out with rerunning pls? |
Yes I tried to rerun, looks like we have some instabilities in the CI… Your changes are fixing all the remaining issues, whenever the pipeline is green, I'll merge them. |
now only one job is cancelled, probably too many processes running in parallel at one |
|
@shulard it seems now all of the jobs ran successfully in the CI 💪 |
|
Yes I create a release now, thank you for this patch 🎉 |
|
Here it is, thank you for your work: https://github.com/friends-of-phpspec/phpspec-code-coverage/releases/tag/v6.5.0 |
The extension fails on PHP 8.4 with a TypeError when PhpSpec's IndexedServiceContainer::get() method expects an object return type but receives an array. This is due to stricter type enforcement in PHP 8.4.
Error:
PhpSpec's service container has a strict return type declaration of object for the get() method, but two services were returning arrays directly:
code_coverage.options- returned configuration arraycode_coverage.reports- returned reports arrayIntroduced wrapper classes to encapsulate arrays while maintaining backward compatibility:
CodeCoverageOptionsClassCodeCoverageReportsClass