-
-
Notifications
You must be signed in to change notification settings - Fork 125
Fix PHP 8.1 deprecations #923
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
public function setPhpPath($phpPath): void | ||
{ | ||
$this->phpPath = escapeshellarg($phpPath); | ||
$this->phpPath = $phpPath ? escapeshellarg($phpPath) : ''; |
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.
is this a phpstan issue or php 8.1 ? should we throw an exception if the string is empty? would adding a type hint string
be enough?
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 didn't want to add types to the signature as that would be an API change. That is probably the better solution in general, but I was going for the absolute minimum impact to make the errors go away as I didn't have the broader context.
Thanks for the merge. I look forward to a release so that I can benchmark a new 8.1 library I'm working on. 😄
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.
ideally I want to get GH actions running with 8.1 before tagging, but Xdebug isn't behaving for some reason, need to investigate...
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.
https://github.com/phpbench/phpbench/releases/tag/1.1.2
the tests worked locally with 8.1+ xdebug, so disabled them in 8.1/GH actions for now
Thanks, i'll look into the above comment |
I am not 100% certain of all of these, but this at least gets my tests locally to pass, except for those that require the git binary. My container doesn't have git in it so that fails. At least I don't get any deprecation warnings.
This works only with the updated Dom library from this PR: phpbench/dom#4
(I have edits allowed, so feel free to fix up anything you'd like done differently. I won't take offense. 😄 )