-
-
Notifications
You must be signed in to change notification settings - Fork 329
Update composer and tests to PHP 8.4 #897
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
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.
The build is failing.
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^9.5", | ||
"phpunit/phpunit": ">=9.5", |
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.
We need to use ^
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 can specify each version if you want, but it is good to be on the latest PHPUnit
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 think I only tested on PHP 8.4, will get older versions working. Generally I drop unsupported PHP versions, but I should be able to make it all work. The build will still fail for PHP 8.4, because it is currently failing on master for PHP 8.4, not sure how to fix.
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.
Unbound versions mean the build is not reproducible and may break as soon as there's a new major version of the dependency.
@@ -138,22 +138,22 @@ class ConstructorInjection | |||
{ | |||
public $value; | |||
public string $scalarValue; | |||
public stdClass $typedValue; | |||
public ?stdClass $typedOptionalValue; | |||
public \stdClass $typedValue; |
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.
No code style changes please.
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.
Not sure what you mean here. \stdClass to just stdClass? \stdClass is sometimes uses, sometimes not in master. Best practice is FQN, so \stdClass everywhere, but I only added where I changed, often to match parameters.
But happy to change.
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.
Let's not change lines unrelated to the PR.
Also I wouldn't call this best practice as they add unnecessary noise to the code. The performance benefit makes sense in very specific cases (and a test is not one of those).
Finally getting back to this. So the current master branch has the following PHPUnit error on all supported versions of PHP:
No idea how to fix this. Also vimeo/psalm does not yet support 8.4, so that causes PHPUnit only support V9. But PHP 8.4 lists all sorts of depreciation issues, which is why I originally opened this PR. There is an open PR vimeo/psalm for this. Not sure how you want to proceed. |
Is there anything we can do to help move this one along so that we can support PHP 8.4? Cheers |
@andrewnicols yes there is, you can pick up this PR and open a new one, the goal is to get the build green |
This is no longer needed as @andrewnicols submitted an updated PR. Closing. |
I updated to the latest dependencies. Also up updated for PHP 8.4 nullable parameter depreciation fix.
The unit tests on the master branch had one failure originally and I did not fix that.
Also upgrading PHPUnit removed the withConsecutive() method. I used Rector to fix, but that introduced another failure. Since I don't know (or use directly) this library, I am not sure how to fix this test or what you are actually trying to test. So you should take a look, probably an easy fix if you know what you want.