Skip to content

Conversation

timoschinkel
Copy link
Contributor

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().

  • Update PHP requirement to ^7.2 || ^8.0
  • Update shivammathur/setup-php to version 2
  • Set Github Actions to be run for PHP versions 7.2, 7.3, 7.4 and 8.0
  • Update PHPUnit requirement to ^8.0 || ^9.0
  • Add phpspec/prophecy as a direct development dependency
  • Replace calls to \PHPUnit\Framework\TestCase::prophesize() with calls to \Prophecy\Prophet::prophesize()

The codebase is compatible with PHP 8.0. This change marks support for PHP 8.0 in our `composer.json` and runs our test suite on PHP 8.0. This required updating `shivammathur/setup-php` action to version 2.
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()`.
@timoschinkel timoschinkel marked this pull request as ready for review November 25, 2020 19:36
@timoschinkel timoschinkel requested a review from a team as a code owner November 25, 2020 19:36
- Update CHANGELOG with PHP 8 support
- Mark changes as version 1.1.0
@timoschinkel timoschinkel merged commit b03a616 into coolblue:main Nov 26, 2020
@timoschinkel timoschinkel deleted the feature/php-8 branch November 26, 2020 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants