qossmic / deptrac

Keep your architecture clean.
https://qossmic.github.io/deptrac
MIT License
2.6k stars 135 forks source link

PHP 8.3 typed constants cause syntax error #1341

Closed benr77 closed 7 months ago

benr77 commented 8 months ago

Using the latest 1.0.2 release, with PHP 8.3, I see

Syntax error, unexpected T_STRING, expecting '=' on line 11

When the PHP class has a typed constant - e.g.

public const string NAME = 'campaign_message_id';

I'm guessing this is because the PHP parser used does not understand the latest syntax.

KorDum commented 7 months ago

I have the nikic/php-parser package version 4.18.0 installed, but I'm still getting this error. Surely an update fixes this?

gennadigennadigennadi commented 7 months ago

@KorDum you might be right. I'm also seeing that error with the most recent main branch, which contains php-parser 4.18.

gennadigennadigennadi commented 7 months ago

image

I double checked it and I can not see an error anymore.

jefhar commented 6 months ago

Is there a new release coming anytime soon (and for deptrac-shim) that fixes this for those of us using version constraints?

KorDum commented 5 months ago

Is there a new release coming anytime soon (and for deptrac-shim) that fixes this for those of us using version constraints?

The developers said the -shim version would no longer be supported. You need to switch to another: qossmic/deptrac:2.0.x-dev. This is works for me.