-
Notifications
You must be signed in to change notification settings - Fork 27
Added compatibility with PHP 8.1 #112
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
Hello @andrewbess, just to confirm, this is not a blocking issue? I'm asking because the unit tests did not point to an issue and if there is, I'd like to add a test to prevent further errors. |
Hello @tomzx I will try to add test here. Thank you in advance. |
Hello @tomzx The results of the tests with fixes provided below So, this library has the necessary tests. |
ef9bee5
to
d31a3d6
Compare
Hello @tomzx |
Hello @tomzx |
Hi @tomzx ! |
@@ -25,7 +25,7 @@ public function __construct() | |||
parent::__construct('PHP Semantic Versioning Checker by Tom Rochette', self::VERSION); | |||
|
|||
// Suppress deprecated warnings | |||
error_reporting(E_ALL ^E_DEPRECATED); | |||
error_reporting(E_ALL & ~E_DEPRECATED); |
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 @tomzx
Please note that while this suppress E_DEPRECATED in "standalone" application there are still deprecation messages generated if this module is used as dependency. Would be great if this PR could be merged and new version released so that issue resolved everywhere
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.
Hello, I've removed the error silencing in v0.15.0. Let me know if this fixed your issue.
@andrewbess Hello @andrewbess, I've updated the code with changes that are mostly similar to what you suggested in your PR (I've opted to use Let me know if you're still facing issue (either by reopening this issue or creating a new one). |
Hello @tomzx
We still have problems with class \PHPSemVerChecker\Report\Report.
The problem looks like showed below when I run phpunit
During inheritance of ArrayAccess: Uncaught PHPUnit\Framework\Exception: Deprecated: Return type of PHPSemVerChecker\Report\Report::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/andrewbess/work/projects/my-project/vendor/tomzx/php-semver-checker/src/PHPSemVerChecker/Report/Report.php:161
We should add attribute #[\ReturnTypeWillChange] above methods offsetExists, offsetGet, offsetSet, offsetUnset, getIterator or we should add return types (that is not BIC) because the return types have been added there in PHP >= 8.0.
This pull request provides the fixes for the class
\PHPSemVerChecker\Report\Report
according to php.net ArrayAccess interface and php.net IteratorAggregate interface. Also, we fixed error reporting insrc/PHPSemVerChecker/Console/Application.php
.Finally, we checked these changes in PHP 7.4, 8.0, 8.1. It works well.
Cloud you please check it?
Thank you in advance.