Giter Club home page Giter Club logo

Comments (3)

patrickkusebauch avatar patrickkusebauch commented on September 26, 2024

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.

ariddlestone avatar ariddlestone commented on September 26, 2024

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 @propertys and @methods, 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.

patrickkusebauch avatar patrickkusebauch commented on September 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.