-
Notifications
You must be signed in to change notification settings - Fork 15
Fully support PHP version 8.4 #20
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
- Fix deprecations for PHP 8.4 - Test with all supported version of PHP through the github actions pipeline which has been removed afterward - Use createFromMethodName instead of the constructor
|
Any news about this PR ? Could you please take a look at it ? |
|
First, thanks for this contribution! Secondly, sorry for taking a while to get to it - I don't have much time for OSS in general, at the moment. Now the GitHub Actions stuff is removed, this PR looks pretty good. A couple of small things though:
|
|
Thanks a lot for the review ! I really appreciate it. Your wishes are my orders :-) Please, let me know if this solution does not fit your expectations. |
- Clean the code, remove duplications - Extract the factory method in a specific method
| use ReflectionMethod; | ||
| use WireMock\Serde\SerializationException; | ||
| use WireMock\Serde\StaticFactoryMethodValidator; | ||
| use const PHP_VERSION_ID; |
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.
I don't think we need this const any more (and ditto in a few other files)?
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.
Shame on me, thanks for pointing this out.
I have fixed it.
| /** | ||
| * @throws ReflectionException | ||
| */ | ||
| public static function createMethod($fqMethodName) { | ||
| return PHP_VERSION_ID >= 80400 | ||
| ? ReflectionMethod::createFromMethodName($fqMethodName) | ||
| : new ReflectionMethod($fqMethodName); | ||
| } |
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.
Sorry to be a pain, but could we put this in its own file / class? Just, conceptually, it doesn't particularly belong with StaticFactoryMethodValidator (any more than it belongs with any of the other places we use it), right?
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.
I completly agree with you. I have then moved that method in a MethodFactory class.
Is it better this way ?
Before merging, I would love to squash my commits.
- Clean the code, fix PR comments
rowanhill
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.
Thanks for making those changes, this looks much better, now.
I'll squash and merge it in!
|
This is now released as Thanks again! |
|
Thanks to you for taking care of the squash and merge! |
Note that github action was temporarily used to test with all supported versions of PHP.
I removed the yml file configuring the github action because it will be costly at some point.