-
Notifications
You must be signed in to change notification settings - Fork 281
Support PHP 8.4/8.5 #5454
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
base: main
Are you sure you want to change the base?
Support PHP 8.4/8.5 #5454
Conversation
| { | ||
| $id = trim($id); | ||
| $timestamp = (int) $timestamp; | ||
| $timestamp = (int) floor($timestamp); |
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.
Please make absolutely sure we're dealing with floats here. My feeling is that this change isn't strictly necessary since we're dealing with timestamps and those are usually a result of time() or DateTime->getTimestamp(), in which case it's always an int.
There are probably other cases as well, I won't comment on each one. Please review them again and ensure on your own that you don't floor unnecessarily. It's maybe also an option to prevent decimals in the first place, given the calls are internal only. Though, an exception is Benchmark, as it already floored its timestamp previously so there's no problem to do it still.
| protected function namespaceHasApplictionDirectory($namespace) | ||
| { | ||
| return array_key_exists($namespace, $this->applicationDirectories); | ||
| return array_key_exists($namespace ?? '', $this->applicationDirectories); |
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.
Why exactly does this need to be guarded but isApplicationPrefix does not? If I follow the calls of namespaceHasApplictionDirectory, I don't seem to find a case when the argument is null.
| protected function extractMessageValue(array $path, array $messageData) | ||
| { | ||
| $key = array_shift($path); | ||
| $key = array_shift($path) ?? ''; |
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.
null won't be part of the array, that's for sure. The regex above must match before this is called and then the match is passed. The recursion on the other hand handles the case already that it stops once the arrays is empty.
|
|
||
| foreach ($permissions as $permission) { | ||
| if (array_key_exists($permission, self::LEGACY_PERMISSIONS)) { | ||
| if ($permission && array_key_exists($permission, self::LEGACY_PERMISSIONS)) { |
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'm pretty sure, that if this would be null, remaining code parts will still fail and would have already anyway. So this can't be necessary. 🤔
| public function order($columnOrAlias, $dir = null) | ||
| { | ||
| if (array_key_exists($columnOrAlias, $this->additionalColumns)) { | ||
| if ($columnOrAlias && array_key_exists($columnOrAlias, $this->additionalColumns)) { |
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.
that's another case of, if you'd follow the alternative path, you'd see that null is not a probably candidate as nothing else works anyway if that's the case.
| protected function hasJoinedVirtualTable($name) | ||
| { | ||
| return array_key_exists($name, $this->joinedVirtualTables); | ||
| return array_key_exists($name ?? '', $this->joinedVirtualTables); |
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.
Hard to believe that this is required, as my usage search didn't reveal a single case of unguessable types, so to say.
|
Also, the changes to the monitoring module seem implausible to be complete. You already acknowledged in person that you didn't test it yet since you don't have the IDO enabled/configured. Please talk to @lippserd whether that's necessary to begin with. |
|
The fact that 730af4c doesn't conditionally call |
04f618b to
bcade4e
Compare
…placed by Pdo\Mysql
…n PHP 8.5, calling it had no effect since PHP 8.1
…t's value is deprecated in PHP 8.4
…r value-altering float to int casts.
bcade4e to
d5c87b1
Compare
21293ec to
d5c87b1
Compare
Changes that had to be addressed
PHP 8.3 -> PHP 8.4
Migration docs: https://www.php.net/manual/en/migration84
session.sid_bits_per_characteris deprecated.PHP 8.4 -> PHP 8.5
Migration Docs: https://www.php.net/manual/en/migration85
instead of PDO::SQL<constant_name> use Pdo\Mysql::<constant_name>.
resolves: #5269
resolves: #5450