-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for typed const - PHP 8.3 #1371
Comments
Hi, there is no roadmap, but to get rid of the error we just meet to update nikic/php-parser. That should be super simple, maybe even a Feel free to take a stab at the first part if you want. |
I will try to do it then |
Hey, currently it is not possible as there is a blocker in infection/infection dependency: |
Hello! I'm using nikic/php-parser v5.0.2, but I still get the error. |
How do you use php-parser v5 ? Composer.json from Deptrac only requires v4. are you using the main branch or the shim version? |
Yes, I'm using shim 1.0.2 that doesn't have requirements: composer show
And php-parser: composer show
I also tried with dev-main with no success. |
Sure, here it is: https://github.com/thomas-hiron/deptrac-reproducer The syntax error also breaks the violation detection: if you delete one of the typed const, there is one violation. I'm running php 8.2 and tried with 8.3 too, no success. |
@thomas-hiron okay, I see what the problem is.
|
There's no syntax error, thanks! I updated the deptrac.yaml but now there is no violation (2 were expected as shown in the reproducer): deptrac:
paths:
- ./src
layers:
- name: Api
collectors:
- type: classLike
regex: .*App\\Api\\.*
- name: Common
collectors:
- type: classLike
regex: .*App\\Common\\.* Did I miss something in the upgrade guide? Any idea? |
With v2|main the default set of registered analyser changed. I think for v1 the set was: analyser:
types:
- "use"
- "file"
- "class_superglobal"
- "function_superglobal"
- "function_call"
If you updated your config, It should behave exactly the same. |
See upgrade documentaion.
|
It's working, thank you! |
Issue resolved. |
Reopening as we now need to generate the dependencies from the types of constant. |
Is there anything we can do to make it work in ^1.0 versions? Also, I think these |
Could you point out what config changes will be problematic for you to upgrade to v2? Also, as soon as possible I will tag a final release. And it will properly be the same commit as the current beta. |
In theory it would be possible to tag a v1.0.3 that supports php8. A PR would be welcome. One would just have to figure out what merges caused the BC, and than would would have to check out the previous commit to the php-parser upgrade and open a PR against the v.1.0 branch. |
I've created 1.0.3 candidate but there is no 1.0 branch so I could open a PR 🤔 https://github.com/qossmic/deptrac/compare/2.0.x...sakowicz:deptrac:php-parser-update?expand=1 |
Check again. It seems that I removed it recently. Now it’s back again. The v1.0 is not branch of the right commit, yet. I’ll have to do this later, because right now I’m not at a computer 😅. |
@gennadigennadigennadi Did you have a chance to take look at that? |
Thanks for merging @gennadigennadigennadi. I wonder if we can release |
Sorry, but the shim version is end of life. And I don’t know how to release the shim version. but feel free to use the 2.0, it’s tagged now. |
@dbrumann I wonder if you can help to release |
Sorry, I am not interested in doing it. |
Hey there!
Not sure what is the current status of support for PHP 8.3 but Deptrac does not support the typed constants:
Is there any milestone/roadmap for PHP 8.3?
The text was updated successfully, but these errors were encountered: