beyondcode/laravel-er-diagram-generator

The nikic/php-parser throws "trailing comma is not allowed" but I use PHP 7.3.22 which allows trailing comma…

Closed this issue · 0 comments

I wanted to use beyondcode/laravel-er-diagram-generator to generate diagram of my Lumen app. Installation went smoothly with no issues.

When I run php aritsan generate:erd I get:

$ php artisan generate:erd

In Php7.php line 1170:

A trailing comma is not allowed here on line 71

I started investigation and I've found that this links to one of my files where indeed I have a comma after the last argument of a method, but the case is that I use both locally and in production PHP in version 7.3.22 and allowance of trailing comma was implemented in 7.3.

So what is the issue? When I remove that comma from the last argument, then the diagram is generated with no issues. How can I fix this without being forced do write older PHP syntax?

Is it something with diagram package or nikic/php-parser, which is a dependency of the diagram package?

Also in my Lumen composer.json I do have indeed different version of PHP:

"require": {
    "php": ">=7.1.3",

but does this matter?

Version that is physically used is:

$ php -v
PHP 7.3.22 (cli) (built: Sep  3 2020 21:17:58) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.22, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.22, Copyright (c) 1999-2018, by Zend Technologies