Hi, sorry for my bad english :)

Drupal 8 can be installed on PHP 7.0.8 or later (php requirements), but this module require at least php 7.1 due to this "phpstorm suggestion": [] in list unpacking can be used in PHP 7.1

The error that is shown is the following:

ParseError: syntax error, unexpected '=' in Composer\Autoload\includeFile() (line 122 of /var/www/html/web/modules/contrib/lazy/src/Form/LazyForm.php).

I think it is necessary to make lazy work with php version 7.0.8 or, alternatively, declare that the minimum usable version is PHP 7.1

In the next commit a proposed patch

Comments

robertom created an issue. See original summary.

robertom’s picture

Status: Active » Needs review
StatusFileSize
new692 bytes

Attached a proposed patch

robertom’s picture

Added an updated patch that remove also the void return type introduced in PHP 7.1 (Void functions)

without this patch, when I go to "/admin/config/content/lazy" I get this error:

The website encountered an unexpected error. Please try again later.
TypeError: Return value of Drupal\lazy\Form\LazyForm::getEnabledFiltersAndFields() must be an instance of Drupal\lazy\Form\void, none returned in Drupal\lazy\Form\LazyForm->getEnabledFiltersAndFields() (line 169 of modules/contrib/lazy/src/Form/LazyForm.php). 
frazras’s picture

This patch works for me

  • osman committed 83306ff on 8.x-3.x authored by robertom
    Issue #3119350 by robertom: Make lazy compatible with php 7.0.8 as...
osman’s picture

Status: Needs review » Fixed

Thanks @robertom.

sandeshyadav’s picture

Patch #3 works for me. Thank you so much @robertom

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.