Add PHP 8 support #8
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The code works as it should under PHP 8. This will mark that it works with PHP 8 in
composer.json
.In order to ensure the code works on PHP 8 as well the inspections should also run on PHP 8. As the library runs perfectly fine on PHP 7.2 and PHP 7.3 I don't see a necessity to drop support for those versions. In order to still support PHP 8 PHPUnit needs to be updated to version 9, but that version drops support for PHP 7.2 and PHP 7.3. The solution is to require either PHPUnit 8 or PHPUnit 9.
This left an issue with the usage of Prophecy as Prophecy is deprecated in PHPUnit 9. As the test suite is so small the solution for this project has been to add
phpspec/prophecy
as a direct development dependency and using Prophecy direct instead of via\PHPUnit\Framework\TestCase::prophesize()
.^7.2 || ^8.0
shivammathur/setup-php
to version 2^8.0 || ^9.0
phpspec/prophecy
as a direct development dependency\PHPUnit\Framework\TestCase::prophesize()
with calls to\Prophecy\Prophet::prophesize()