This module currently requires PHP versions that permit trailing commas in function calls, which was first implemented in PHP 7.3. See: https://wiki.php.net/rfc/trailing-comma-function-calls. While Drupal 9 does require PHP 7.3+, versions of Drupal 8 that this module supports do not. Attempting to install this module with PHP versions < 7.3 will result in errors similar to

ParseError: syntax error, unexpected ')' in layout_builder_blocks/src/EventSubscriber/BlockComponentRenderArraySubscriber.php on line 79.

Options to fix this would include:

  1. Refactoring code to not use trailing commas in function calls (and any other PHP <=7.3 breaking changes)
  2. Changing the module's core version requirement to only be D9+
  3. Noting somewhere that this module requires at least PHP 7.3

Option 3 may be sufficient, however, the issue presented here may also be responsible for #3166059: Unexpected error after installation

Comments

komlenic created an issue. See original summary.

komlenic’s picture

Issue summary: View changes
mahmoud-zayed’s picture

Component: Documentation » Code
Assigned: Unassigned » mahmoud-zayed
Status: Active » Needs work

Hi Chris,

Thanks for reporting this bug. I think option one would be the optimal solution since its just simple change and it will allow who has PHP7.1+ to use this module.

Regards,
Mahmoud

mahmoud-zayed’s picture

Title: Requires PHP >= 7.3 » ParseError: syntax error, unexpected ')' in layout_builder_blocks/src/EventSubscriber/BlockComponentRenderArraySubscriber.php on line 79

  • mahmoud-zayed committed 645f845 on 1.0.x
    Issue #3166635 by mahmoud-zayed: remove trailing comma in the function...
mahmoud-zayed’s picture

Assigned: mahmoud-zayed » Unassigned
Status: Needs work » Fixed
mahmoud-zayed’s picture

Status: Fixed » Closed (fixed)

Added to 1.0.0-alpha3