3.1.1 PHP 7.4 ParseError: unexpected '|'

Created on 16 August 2023, about 1 year ago
Updated 18 August 2023, about 1 year ago

When upgrading to 3.1.1 or 3.0.4 on PHP 7.4 environment I encounter the following error:
ParseError: syntax error, unexpected '|', expecting variable (T_VARIABLE) in Composer\Autoload\includeFile() (line 631 of opigno_module/src/Entity/OpignoModule.php).

It looks like the update is incompatible with PHP 7.4 and completely shuts down my environment. Attempts to downgrade have so far been unsuccessful.

Has anyone else run into this issue?

🐛 Bug report
Status

Needs review

Version

3.1

Component

Code

Created by

🇺🇸United States rudy.barrett

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @rudy.barrett
  • 🇮🇳India dineshkumarbollu

    This issue is getting because int|string not a valid syntax. we can use mixed type instead.

  • Status changed to Needs review about 1 year ago
  • 🇺🇸United States rudy.barrett

    Above PAtch works, however it looks like that is not the only instance.

    ParseError: syntax error, unexpected '|', expecting variable (T_VARIABLE) in Composer\Autoload\includeFile() (line 275 of /opigno_module/src/Entity/UserModuleStatus.php)

    ParseError: syntax error, unexpected '|', expecting variable (T_VARIABLE) in Composer\Autoload\includeFile() (line 118 of /opigno_module/src/Entity/UserModuleStatusInterface.php)

    ParseError: syntax error, unexpected ')', expecting variable (T_VARIABLE) in Composer\Autoload\includeFile() (line 543 of /opigno_learning_path/src/Services/LearningPathContentService.php)

    And it's possible there are more, those are just the first 3 I found. I don't think this version of Opigno LMS is compatible with PHP 7.4.

    Maybe another solution would be to put in a PHP8.0 restriction on the update/install.

Production build 0.71.5 2024