-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Update tests and add PHP 8.3 to the CI matrix #3299
Conversation
From PHP 8.3, calling ReflectionProperty::setValue() with a single value is deprecated, so we use ReflectionClass::setStaticPropertyValue() instead.
It's not used and causes a warning.
Dynamically adding a property to a class is deprecated and so rather than adding the request to the response from the handler, we now add it to the handler itself and test it there.
Also use 8.2 for the CS and static analysis tests.
c5df4e7
to
85a19ec
Compare
@akrabat it appears installing the dependencies fails on PHP 8.3 |
Yes. See "note" in PR description :) |
@akrabat my apologies 😅 I guess we'll just have to be patient! |
Seems that phpspec/prophecy now supports PHP 8.3 (commit 3 days ago): |
Thanks @stemd. I have re-run the PHP 8.3 CI test and it passed. Over to @l0gicgate for review. |
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.
For cohesion, can we please import ReflectionClass
in the import statements instead of using \ReflectionClass
. Looks great otherwise, thank you for this contribution.
Done. |
A few things that we were doing in the tests are deprecated and so have been updated to be correct.
setStaticPropertyValue()
to set static properties on a reflected class rather thansetValue()
on a reflected property.request
property to the response class inBodyParsingMiddlewareTest
, instead we add it to our handler class.ErrorHandlerTest
.I have also added PHP 8.3 to the CI matrix and moved our static analysis tests to PHP 8.2.
Note that we'll need to wait for
phpspec/prophecy
to support PHP 8.3 before we can merge.