Comments (4)
from dephpend.
Hi mihaeu, I'm glad you agree that this is would be a helpful feature!
I may be able to help with implementing this. This functionality would help me a lot!
from dephpend.
Well, help is always appreciated :)
I have a long flight today, so I have some time to work on all your ideas :)
But dePHPend's architecture is quite simple actually.
All selected PHP files are parsed and then analyzed. After that, you've got a map of dependency tuples. Prefilters are run on every command and reduce that map depending on which filter was used (mostly selectors like regex etc.). Post processors are passed as callables depending on the command because those change how dependencies are displayed (e.g. you cannot strip classes from a namespace before counting how many classes are in a namespace, even though afterward you're only interested in the namespace).
Long story short what needs to happen for detecting visibility:
- add the property to the Dependency value object
- extend the src/Analyser/DependencyInspectionVisitor.php to add this information when encountering a property node
- adjust output accordingly (probably best done by implementing a post-processor option
--scope
or--visibility
)
Similarly, if you want to track deprecated methods you want to extend the inspector and (in this case) write a prefilter for it.
This might actually be a point where it could make sense to split up the inspector and inject which visitors are supposed to be used. It was mostly a performance and laziness decision to not do that in the first place. It might be worth benchmarking if the DependencyInspector can be split up into separate visitors, but honestly, I'm fine with the mess in there ... maybe one day I'll get around to fixing that.
from dephpend.
I still see this as a very interesting feature, but also one that requires keeping track of state and doing multiple passes over all dependencies.
I'm guessing you already solved this issue, since it's 2 years old now
from dephpend.
Related Issues (20)
- Release Artifact: Can't check signature: No public key HOT 16
- 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
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.