-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add compatibility for PHP8 #116
Conversation
d354a02
to
e188f32
Compare
71f5c13
to
43b04c2
Compare
12fbe26
to
e8d8b99
Compare
We found that Coveralls is not able to merge coverage reports from different job runs. Since supporting PHP8, we have different code branches in order to support the old and the new PDO interface. So, it is crucial to merge coverage reports from two job runs, one for PHP7.4 and another for PHP8.
This will aid on running the tests with coverage on both PHP7 and PHP8, merge coverage reports and render them as HTML to be inspected by humans. It's not completely maintenance free because some paths will probably have to be adjusted for others, but it's way better than nothing.
With the introduction of PHP8 compatibility, some `class_alias` code has been introduced. We have not been able to make PHPUnit grok the coverage of this code by other means. Additionally, some annotations have been added to improve code coverage metrics on code which actually has been covered but was not accounted.
if ($fetchMode !== null) { | ||
throw new UnsupportedException('PDO::query $fetchMode not implemented yet'); | ||
} | ||
// FIXME: return $this->doQuery($query, $fetchMode, ...$fetchModeArgs); |
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.
With the updates to the PHP PDO interface, query()
operations using fetch styles/modes are now possible directly on the main PDO object reference. In earlier versions, a PDOStatement was needed for that.
While this patch already brings in PHP8 compatibility in general, this specific detail has not been implemented yet and has to be eventually followed up on, see #117.
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.
Great stuff, added some questions.
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.
👍
Hi there,
PHP 8.0.2 has been released and PHP 8.1.x is in the making. This addresses #115 by adding compatibility for PHP8.0 and deprecating support for PHP7.2, which reached end of life. At the same time, we upgraded to PHPUnit 9.x.
Because PHP's PDO interface has changed, we tried to align to what Doctrine and Drupal were doing to be compatible with both PHP7 and PHP8.
Reason:
Implementation derived and inspired from:
With kind regards,
Andreas.