This issue only arose when I installed the devel module. Previously I had cleared cache on more than one occasion.
Currently I have the update deployed on the live site and it is not erroring on PHP7.4 but I'm certain the error will emerge sooner or later,
ParseError: syntax error, unexpected 'protected' (T_PROTECTED), expecting variable (T_VARIABLE) in Composer\Autoload\includeFile() (line 39 of modules/contrib/entity_legal/src/Form/EntityLegalDocumentForm.php).
These 3 lines are only allowed in > PHP8.0
protected PluginManagerInterface $pluginManager,
protected AccountProxyInterface $currentUser,
protected RendererInterface $renderer
Here is my patch attached (sorry I do not know how to do this the Drupal way)
This appears to fix the issues but I wonder if there are any other areas of the code that need addressing.
Composer install of the latest module does not check the PHP version.
Could you confirm if this is a valid approach?