Comments (6)
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.
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.
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.
@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.
This is now supported, but you have to write @var ObjectRepository<PowerDNSDomain>
.
from phpstan-doctrine.
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)
- MappingException since 1.3.55 HOT 2
- Performance issues after 1.3.54 HOT 19
- PHPStan crashes if Doctrine Column is a UnitEnum (PHPStan+Doctrine extension) HOT 2
- False Possitive in Abstract Respoitory classes mapped to Abstract Entity classes: "<entity> has no field or association named <field>" HOT 5
- Comparing the database mapping type to the property type should take the phpstan level into account HOT 2
- Compatibility with doctrine/orm:3 HOT 9
- doctrine/orm v3 - Declaration of ClassMetadataFactory::newClassMetadataInstance($className) HOT 4
- Incorrect PHPStan Error for Method Return Type Declaration HOT 2
- Enforce `Connection::executeQuery` on SELECT and `Connection::executeStatement` on others queries HOT 7
- Repository methods considered pure
- support for doctrine/orm 3+? HOT 6
- Query analyser gets confused when a join alias is equal to the relation name
- Use DTO in a query builder HOT 7
- Add UniqueEntity constraint field validation
- False positive when working with ArrayAccess HOT 21
- Since v1.3.64: Interface "PHPStan\Classes\ForbiddenClassNameExtension" not found HOT 6
- Incompatible bleedingEdge Connection stub typehint with DBAL 4 HOT 5
- Report an error for QueryBuilder::setParameter without specifying the Type. HOT 10
- Query result type is not recognized if the alias is `"attribute"`
- Autogenerated id column should be positive-int 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 phpstan-doctrine.