Problem/Motivation
Since version 8.x-1.20
The info.yml file doesn't restrict the php version (to php 8.*).
But src/Plugin/Filter/FilterTooltips.php implements php 8.0 code in the constructor.
protected EntityTypeManagerInterface $entityTypeManager,
protected Renderer $renderer
Steps to reproduce
Install the module on a php 7.4 environment and with composer.json set to php 8.4
"config": {
"platform": {
"php": "7.4"
}
}
Visit the site.
Inspect the error logs.
The website crashes (or at least the part where the code runs).
The recent log messages will show a php error message that contains something like: unexpected 'protected' (T_PROTECTED), expecting variable
Proposed resolution
Since there is a 8.x-1.x.x branch and a 2.x.x branch.
I'd suggest to keep the 8.x-1.x.x branch compatible with 7.4 by removing the 'protect' keywords.
For the 2.x.x branch php 7.4. compatibility is probably not that an issue, but to prevent accidentally installation I suggest to add the minimum php version to the info.yml
php: 8.0
See:
https://www.drupal.org/docs/develop/creating-modules/let-drupal-know-abo... →
I'll provide a patch for the 8.x-1.x.x with php 7.4 compatibility.
Remaining tasks
Applying patch and/or set minimum php version in info.yml