localgovdrupal / localgov

Installation profile for the LocalGov Drupal distribution.
GNU General Public License v2.0
81 stars 18 forks source link

Support PHP 8.* #424

Closed stephen-cox closed 2 years ago

stephen-cox commented 2 years ago

We should support PHP 8. I'm reasonably sure LocalGov Drupal will run with PHP 8.0. but tests currently run against PHP 7.4.

At a minimum we need to update the tests to run against 8.0. Should we then change the main supported PHP version to 8?

finnlewis commented 2 years ago

Also see https://github.com/localgovdrupal/localgov_project/issues/65

finnlewis commented 2 years ago

I think we probably need to support PHP 7.4 and PHP 8.1 for a bit, but there are already contrib modules that are making releases that only work on PHP8+ (https://www.drupal.org/project/date_recur)

This is where it would be really good to have a list of live sites, with PHP versions to know our audience a bit better.

finnlewis commented 2 years ago

Actually - we should probably follow Drupal's recommendations:

https://www.drupal.org/docs/system-requirements/php-requirements#versions

PHP version Supported by Drupal First Drupal release with support Recommended?
7.3 9.x 8.6.4 (note 1 below) No
7.4 9.x 8.8.3 No
8.0 9.x 9.1.0 Yes
8.1 (note 2 below) 9.x, 10.x 9.3.0 Yes

So support but not recommend PHP 7.3 and 7.4

finnlewis commented 2 years ago

The suggestion on today's Merge Monday call was to test against PHP 7.4 and 8.1 for most module repositories, but to do a more full test on the localgov profile repo to include 7.4, 8.0, 8.1 and run tests across all the code on a regular daily schedule.

Anything else we need to do on this issue @stephen-cox ?

stephen-cox commented 2 years ago

To support PHP 8.1 we need to upgrade phpstan in the localgov_project: https://github.com/localgovdrupal/localgov_project/issues/65#issuecomment-1095145300

Fix some PHP Unit tests:

Fix some code deprecation issues that come from the phpstan upgrade:

finnlewis commented 2 years ago

So @stephen-cox I think this one is done, no?