Comments (4)
from dephpend.
Yea, I know what you mean. It would probably not be good to just ignore those, always. But I want to be able to pick and choose. So having a dependency-type "name" or "constant" would be helpful, since then I could filter them out when I don't care about them.
I didn't even think about actual constants, by the way - but you are right, Foo::BAR and Foo::class are not so different. Except the latter doesn't require the class to exist or be loaded.
My use case is that some code may use class literals to implement a kind of soft dependency, registering classes by name and using reflection to instantiate them, only relying on some known interface when using the instances. This patterns is quite common in the code I work with, and I'd like to be able to ignore this kind of dependency, since it'S a lot less problematic than other kinds (even though I'd prefer it to go away as well).
from dephpend.
I just learned about "connascence" metrics [1] that differentiate between different types and dependencies. This goes into the same direction I was thinking in here: distinguishing different kinds of dependencies allows for more meaningful analysis of the dependency graph. For instance, dependencies on behavior (use) are transitive, while dependencies on names (mention) are not (or at least not always).
[1] https://en.wikipedia.org/wiki/Connascence
from dephpend.
Thought some more about this, but if someone adds a non-existing XYZ::class
somewhere I would still want this to show up, especially when writing architecture tests. If there are exceptions those can still be filtered using regex provided by the dephpend
option.
from dephpend.
Related Issues (20)
- When reporting syntax errors, mention the file name
- Incompatible with symfony/event-dispatcher 4.3 HOT 3
- Write errors to stderr not stdout HOT 1
- Show global namespace in --no-classes HOT 1
- SSL_ERROR_BAD_CERT_DOMAIN when trying to download phar. HOT 5
- Error running text mode HOT 8
- Wrong argument on ensureDestinationIsWritable() HOT 5
- Error in text mode HOT 5
- Update to Symfony 5. HOT 2
- Website down? HOT 3
- Mihaeu\PhpDependencies\Util\DI is missing HOT 2
- Unable to execute this tool HOT 2
- It cannot parse this php 8 code. HOT 3
- broken link to animated timeline in README.md HOT 4
- Expired certificate in verification signature
- Multiple derprecations in php 8.1 HOT 1
- unexpected T_STRING error reported for php 8.1 enum
- "PlantUML installation not found" despite PlantUML being globally installed HOT 1
- Support for PHP 8+ HOT 4
- PHP 8.2 Support
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 dephpend.