Comments (5)
It's simple - getBankAccount()
can always return null because you cannot be sure about the inner state of the object.
Yep, your suggestion is correct - you should use a non-nullable getter in cases you're sure there is definitely the bank account set.
from phpstan-doctrine.
from phpstan-doctrine.
This would be really hard to track in a codebase.
I don't know, but it's still a false positive AFAIK. IMHO, the issue should be still open. Maybe somebody will find a solution for that. ๐
you can fetch
customer with a bank account and later set it to null, confusing the
analyser.
I'm not sure to follow you here. What do you mean by set it to null? On the codebase? In this case, it can be done for anything. ๐ค
Or are you referencing the fact that the return value of getBankAccount
can be null? You are maybe right indeed, but what should we do in this case? A special method getExistingBankAccount
without possible null return? Something else? ๐ค
from phpstan-doctrine.
Ok I see, thanks for your time @ondrejmirtes! ๐
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)
- Unable to run rector process after upgrading to release 1.3.54 HOT 9
- self::class in entity is interpreted in wrong context HOT 3
- 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
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.