Comments (24)
Hey, currently it is not possible as there is a blocker in infection/infection dependency:
from deptrac.
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 composer update
might suffice. To actually use the type in constant to define dependencies, would be a bit more work.
Feel free to take a stab at the first part if you want.
from deptrac.
I will try to do it then
from deptrac.
@thomas-hiron okay, I see what the problem is.
deptrac-shim
will not support php8.3, instead it will be sunsetted soon. Please use instead qossmic/deptrac
-> dev-main
or give the pre-release v2 a try. Those support php8.3, because they already require php-parser v4.18.
from deptrac.
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.
from deptrac.
Hello! I'm using nikic/php-parser v5.0.2, but I still get the error.
Any idea where the issue can be? Thanks!
from deptrac.
Hello! I'm using nikic/php-parser v5.0.2, but I still get the error. Any idea where the issue can be? Thanks!
How do you use php-parser v5 ? Composer.json from Deptrac only requires v4.
are you using the main branch or the shim version?
from deptrac.
Yes, I'm using shim 1.0.2 that doesn't have requirements:
composer show
name : qossmic/deptrac-shim
descrip. : deptrac phar distribution
keywords :
versions : * 1.0.2
released : 2022-12-02, 1 year ago
type : library
license : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText
homepage :
source : [git] https://github.com/qossmic/deptrac-shim.git 3179
dist : [zip] https://api.github.com/repos/qossmic/deptrac-shim/zipball/3179
path : /var/www/html/vendor/qossmic/deptrac-shim
names : qossmic/deptrac-shim, qossmic/deptrac
support
issues : https://github.com/qossmic/deptrac-shim/issues
source : https://github.com/qossmic/deptrac-shim/tree/1.0.2
requires
ext-json *
ext-tokenizer *
ext-zlib *
php ^8.1
suggests
ext-dom For using the JUnit output formatter
replaces
qossmic/deptrac self.version
And php-parser:
composer show
name : nikic/php-parser
descrip. : A PHP parser written in PHP
keywords : parser, php
versions : * v5.0.2
released : 2024-03-05, last week
type : library
license : BSD 3-Clause "New" or "Revised" License (BSD-3-Clause) (OSI approved) https://spdx.org/licenses/BSD-3-Clause.html#licenseText
homepage :
source : [git] https://github.com/nikic/PHP-Parser.git 13967
dist : [zip] https://api.github.com/repos/nikic/PHP-Parser/zipball/13967
path : /var/www/html/vendor/nikic/php-parser
names : nikic/php-parser
support
issues : https://github.com/nikic/PHP-Parser/issues
source : https://github.com/nikic/PHP-Parser/tree/v5.0.2
autoload
psr-4
PhpParser\ => lib/PhpParser
requires
ext-ctype *
ext-json *
ext-tokenizer *
php >=7.4
requires (dev)
ircmaxell/php-yacc ^0.0.7
phpunit/phpunit ^7.0 || ^8.0 || ^9.0
I also tried with dev-main with no success.
Do you know any other conf I can try?
from deptrac.
The first part is totally fine. Deptrac-shim provides a phar and is isolated from the other dependencies you install.
dev-main
on the otherhand should work with typed const
.
Would you be so nice and prepare a reproducer?
FYI: I don't get any errors with php8.3 code for the main branch (running deptrac with php8.1)!
from deptrac.
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.
But I guess that's expected given the error.
I'm running php 8.2 and tried with 8.3 too, no success.
from deptrac.
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?
from deptrac.
Did I miss something in the upgrade guide? Any idea?
See upgrade documentaion.
Changed default dependency emitters from CLASS_TOKEN + USE_TOKEN to CLASS_TOKEN + FUNCTION_TOKEN. You can get the old behaviour by explicitly specifying the old emitters in your config file.
from deptrac.
It's working, thank you!
from deptrac.
Issue resolved.
from deptrac.
Related Issues (20)
- Error message when using anonymous readonly class in php 8.3 HOT 3
- Nullable IntersectionType error HOT 2
- PHP 8.3 typed constants cause syntax error HOT 5
- Generating image: Argument ($hiddenLayers) must be of type array null given HOT 2
- New Release HOT 5
- Deptrac does not recognize type aliases HOT 3
- Option to ignore baseline in graphviz output
- Dependabot overfloods this repository HOT 2
- Add support for mermaid formatters HOT 4
- Referencing non-existing layer in depfile emits no error, but breaks the referencing layer HOT 2
- PHP 8.3 new override attribute HOT 2
- Add ability to disable "Parsing File" output HOT 2
- Allow usage of debug:unassigned in CI or add `--fail-on-unassigned`
- Ability to disable `@internal` feature HOT 4
- `@template-covariant` type always appears in Uncovered HOT 9
- Ability to add custom `PhpParser\NodeVisitor` to alter AST attributes HOT 7
- Modularization and Encapsulation Support in Deptrac Configuration HOT 4
- Vendor folder as a layer question HOT 1
- How to install deptrac via composer HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deptrac.