phpstan-doctrine
phpstan-doctrine copied to clipboard
Doctrine extensions for PHPStan
It works fine with version 1.3.28 but since version 1.3.29 with this commit https://github.com/phpstan/phpstan-doctrine/commit/4490e56f6fe3f8985a03be073d4545c3fb59cdbb , when using a query builder with indexBy refering to a OneToOne relation, I get the...
When using `listType: true` feature toggle from bleeding edge, and using the `list` type as the return type of a repository method that returns the result of `getResult()`, we have...
Having following entity with custom type and descriptor: ```php enum FeeCategory: string {} #[Entity] class Fee { #[Column(type: FeeCategoryType::NAME] private FeeCategory $feeCategory; } class FeeCategoryType extends StringType { final public...
So we have this case where we override the `createQueryBuilder` method in one of our entity repositories to provide a specialised QueryBuilder that has some helper methods to work with...
Following error appeared after upgrading from 1.3.14 to 1.3.15. Easily fixable by using array and creating collection later, so I assume this is minor issue. ```php /** * @return Collection...
The idea would be to introduce a rule similar to https://github.com/psalm/psalm-plugin-symfony/issues/158 in psalm. According to the psalm issue and the doctrine related issue https://github.com/doctrine/orm/issues/8113 there is a performance issue when...
Symfony provides a UniqueEntity annotation https://symfony.com/doc/current/reference/constraints/UniqueEntity.html The first arguments need to be entity fields, which will be use by a `findBy` call (by default). So a rule could be implemented,...
Can the following code work without manually defining the return type, i.e adding `/** @var UserDto[] */`? ```php final class Repository { public function __construct( private EntityManagerInterface $em ) {...
Hi, this code fragment triggers a “Could not analyse QueryBuilder with dynamic arguments” error. ``` $builder = $entityManager->createQueryBuilder(); $builder->from(MyEntity::class, 'rr'); $builder->addSelect('rr'); $builder->leftJoin('rr.user', 'user'); $builder->addSelect('user'); $builder->leftJoin('user.role', 'r'); $builder->addSelect('r'); // Error here:...
I just upgraded orm from `2.19.0` to 3.1.0`, and as a result all of my repositories are now showing phpstan errors that this package was formerly handling, such as: ```...