Code Monkey home page Code Monkey logo

Comments (6)

ondrejmirtes avatar ondrejmirtes commented on June 14, 2024

This is currently not possible because there's no way how to write a @var above a property that would tell that there's EntityRepository<PowerDNSDomain>. That would require a lot of coordinated effort across phpstan/phpdoc-parser and phpstan/phpstan which is planned for the future but not on the immediate roadmap. cc @JanTvrdik thoughts?

from phpstan-doctrine.

JanTvrdik avatar JanTvrdik commented on June 14, 2024

Well, phpstan/phpstan uses DI, so in theory extensions can extend a LOT more stuff, than is officially documented, i.e. phpstan/phpstan-doctrine can decorate the TypeNodeResolver service to resolve EntityRepository<PowerDNSDomain> to EntityRepositoryType . No changes to phpstan/phpdoc-parser are required.

That being said, extending and decorating core phpstan services should probably not be encouraged.

from phpstan-doctrine.

ondrejmirtes avatar ondrejmirtes commented on June 14, 2024

That's nice to know! I don't consider TypeNodeResolver as a public API with any BC incentives so I'd rather have an official extension point, but this can be used meanwhile...

from phpstan-doctrine.

lcobucci avatar lcobucci commented on June 14, 2024

@soullivaneuh @ondrejmirtes it looks like this has already been fixed in newer versions of PHPStan (as proven by #37).

Edit: this comment is actually invalid, PHPStan is not validating the method calls as I expected.

from phpstan-doctrine.

ondrejmirtes avatar ondrejmirtes commented on June 14, 2024

This is now supported, but you have to write @var ObjectRepository<PowerDNSDomain>.

from phpstan-doctrine.

github-actions avatar github-actions commented on June 14, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from phpstan-doctrine.

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.