phpstan-doctrine icon indicating copy to clipboard operation
phpstan-doctrine copied to clipboard

Doctrine extensions for PHPStan

Results 110 phpstan-doctrine issues
Sort by recently updated
recently updated
newest added

Hello there, I'm having quite a hard time getting my head around this : [final methods in Doctrine Entities](https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/architecture.html#entities). There's [a PR](https://github.com/phpstan/phpstan-doctrine/pull/143) that added a check that Entities cannot be...

Using `...$arguments` notation when calling functions such as `orX(...$orParts)` results in phpstan error ``` In Base.php line 95: Expression of type '' not allowed in this context. ``` This appears...

I have a decimal column in one of the entities, annotating its type with float throws this: `database can contain string but property expects float.` I'm not sure what the...

With the property: ```php class Foo { /** * @var 1|2|3 * * @ORM\Column(type="smallint", options={"unsigned": true}) */ private $foo; } ``` The following error is reported: ``` Property Foo::$foo type...

methods [\Doctrine\ORM\AbstractQuery::setParameters](https://github.com/doctrine/orm/blob/e77091399a4475630a833fc33bff0d54c194511a/lib/Doctrine/ORM/AbstractQuery.php#L321) and [\Doctrine\ORM\QueryBuilder::setParameters](https://github.com/doctrine/orm/blob/e77091399a4475630a833fc33bff0d54c194511a/lib/Doctrine/ORM/QueryBuilder.php#L563) (see also [this](https://github.com/doctrine/orm/blob/master/UPGRADE.md#query-querybuilder-and-nativequery-parameters-bc-break)) have note about new `setParameters` syntax with `ArrayCollection` I think it will be cool if there will be warning about that in phpstan

There should be a DynamicReturnType for `Doctrine\Common\Annotations\Reader`. The `getClassAnnotation`, `getMethodAnnotation` and `getPropertyAnnotation` can only return the requested annotation or `null`.

Property may be writable if it mapped by doctrine

Hi, i got this error : ``` Parameter #2 $x of method Doctrine\ORM\Query\Expr::between() expects string, int|string given ``` But if i look in lib/Doctrine/ORM/Query/Expr.php, i got theses params : ```...

I have a method as follows: ``` protected function foo(): void { $qb = $this->entityManager->createQueryBuilder(); if (mt_rand(0, 1) === 0) { $qb->select('e.f1', 'e.f2'); } else { $qb->select('e.f3', 'e.f4'); } \PHPStan\dumpType($qb);...