- Issue created by @johnv
- 🇳🇱Netherlands johnv
Types constants already existin PHP 7.1.0:
https://www.php.net/manual/en/language.oop5.constants.phpResetting the core version requirement to : core_version_requirement: ^8 || ^9 || ^10 || ^11
- 🇬🇧United Kingdom millnut
Hi, this breaks when running the module in PHP 8.1 and PHP 8.2.
Constant visibility modifiers have existed since 7.1, however typed constants were only introduced in PHP 8.3 and later https://php.watch/versions/8.3/typed-constants
- 🇳🇱Netherlands johnv
Thanks for your feedback.
What do you suggest me to do?
It seems the change needs to be undone, then generate a new verson 8.x-1.22, then create a new branch 11.x-1.22, and chagne that version.
I seems current version (well, 8.x-1.19) is pretty stable, and changes are pretty much 'techinical debt' due to core / php changes. - 🇬🇧United Kingdom millnut
Hi @johnv I guess there are two ways to approach this;
1. revert the types on constants
e.g.
public const string UPDATE = 'office_hours.update';
for < PHP 8.3 this would work
public const UPDATE = 'office_hours.update';
2. add a php composer requirement in composer.json to the next release, so if users are running < PHP 8.3, the module won't upgrade unless the requirements are met
"require": { "php": ">=8.3.0" },
- 🇳🇱Netherlands johnv
Thanks, first step from the 'Remaing tasks' section: revert the type class constants
- 🇳🇱Netherlands johnv
Postponed until a newer major version of Drupal (D12? D13? )