You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently in the process of improving my codebase with static analysis (PHPStan in this case), and I've found an interesting use case to improve the ObjectRepository interface: I find it pretty annoying have to specify/check each time that I don't expect null values from my find()/findOneBy() methods etc, so it would be nice if there was some get*() twin methods for which a nullable return would not be allowed.
This is obviously a BC, so it should target 3.0, hence leveraging nullable types from PHP 7.1 it would make really sense.... What do you think?
PS: since we already have doctrine/common#826 doctrine/common#738 etc, maybe we can create a 3.0 milestone?
The text was updated successfully, but these errors were encountered:
It could be done similarly to AbstractQuery::getSingleResult()/AbstractQuery::getOneOrNullResult(), although find with null should probably be the happy path since catching exception is more costly.
maybe we can create a 3.0 milestone
Doctrine Common is to be split and obsoleted for 3.0 (see #826) so I don't think that tracking 3.0 milestone here is a way to go in long-term.
I'm currently in the process of improving my codebase with static analysis (PHPStan in this case), and I've found an interesting use case to improve the
ObjectRepository
interface: I find it pretty annoying have to specify/check each time that I don't expect null values from myfind()
/findOneBy()
methods etc, so it would be nice if there was someget*()
twin methods for which a nullable return would not be allowed.This is obviously a BC, so it should target 3.0, hence leveraging nullable types from PHP 7.1 it would make really sense.... What do you think?
PS: since we already have doctrine/common#826 doctrine/common#738 etc, maybe we can create a 3.0 milestone?
The text was updated successfully, but these errors were encountered: