Comments (3)
Do you have some documentation reference to those frameworks? If we do this, ai would like to do it right, such that it does not break for some unforeseen circumstances.
from deptrac.
Sure - the framework I'm working with at the moment is some (very legacy) code in CakePHP 2 (https://book.cakephp.org/2/en/index.html).
In this framework various class types can access other class types through magic properties, for example $controller->model
, or $model->otherModel
. There are quite a few different potential links between class types like this, and working out which are available where is a little complex (it depends on class names, and also a few class property values). Models can also "inherit" methods from behavior classes, but when this happens the model is passed as the first parameter, so the method in the model is missing the first parameter of the behavior's method.
To allow us to perform useful static analysis and use IDE autocomplete etc. we've started manually adding these properties and methods as doc block @property
s and @method
s, similar to the doc blocks produced by https://github.com/barryvdh/laravel-ide-helper. In Laravel however, as models, controllers, etc. exist in different namespaces, deptrac sees the dependencies because of the use ...
lines at the top of the file. In CakePHP 2, there is no namespacing, so no use
lines.
It would be great to be able to generically catch these docblock annotations in the way that IDEs do, so we can see the dependencies., It would then be up to us to separately maintain the correct docblock, or find/modify/create a tool to update it, which we do anyway for the benefit of IDEs, phpstan, etc.
from deptrac.
Oh, now I realized. It has been years since I've seen these. Sure that makes sense, we should add those, no problem.
from deptrac.
Related Issues (20)
- Does `functionName` only support functions with namespaces? HOT 2
- Cannot configure skipViolations with DeptracConfig HOT 1
- Problem with duplicate functions and classes HOT 1
- PHP Fatal error on v2.0 (EventHelper::__construct(): Argument #1 ($skippedViolations) must be of type array, null given) HOT 3
- Unable to use custom `EventSubscriberInterface` in depfile since 2.0 as those are prefixed in the phar HOT 8
- PHP Warning: Undefined array key "internal_tag" HOT 5
- Unable to customize DIC services since 2.0
- composer doesn't allow to check exclusion from one of the packages HOT 2
- Option --version does not show correct version - ^2.0 HOT 2
- v2.0.0 includes unnecessary files HOT 1
- Upgrade guide is not up to date on the website HOT 1
- Option --report-uncovered placed before --config-file makes deptrac ignore the provided configuration file HOT 2
- Upgrade Php-Parser from 4 to 5 HOT 1
- outdated docs HOT 3
- Warning: Undefined array key "internal_tag" in DependsOnInternalToken.php HOT 3
- Github-Action for deployment
- DX: misleading error messages
- Formatter "graphviz-dot" generating different files on same code base HOT 2
- ComposerCollector doesn't allow to check exclusion from one of the packages HOT 1
- Private collectors no longer work HOT 2
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.