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

Doctrine extensions for PHPStan

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

Consider the following construct ```php #[ORM\Entity] class A { #[ORM\OneToOne(inversedBy: 'a', cascade: ['persist'], fetch: 'EXTRA_LAZY')] private ?B $b = null; } #[ORM\Entity] class B { #[ORM\OneToOne(mappedBy: 'b')] private A $a;...

v2.1.31 was ok. ```php

This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/checkout](https://redirect.github.com/actions/checkout) | action | major | `v5` -> `v6` | | [peter-evans/repository-dispatch](https://redirect.github.com/peter-evans/repository-dispatch) |...

Check valid field names are used in orderBy parameter of findBy and findOneBy repository methods (issue #674). Unfortunately this won't catch a nested call like this: ``` public function findAll(array...

It would be great if Collection::filter() would also be able to narrow types. ``` class Group extends Node /** * @var Collection */ #[ORM\OneToMany(targetEntity: Node::class, mappedBy: 'parent')] private Collection $children;...

Similar to https://github.com/phpstan/phpstan-doctrine/pull/685 This would avoid issue like this one https://github.com/phpstan/phpstan-phpunit/issues/232#issuecomment-3451309629 (cc @greg0ire) Another solution could be to merge https://github.com/phpstan/phpstan-src/pull/4422 and use the new tag on the whole class.

while [exploring mutation testing](https://github.com/phpstan/phpstan-doctrine/pull/686) I am stumbling over a failling CI test: https://github.com/phpstan/phpstan-doctrine/actions/runs/18255085404/job/51975257235?pr=686 ``` There was 1 failure: 1) PHPStan\Platform\QueryResultTypeWalkerFetchTypeMatrixTest::testPgsql with data set "t.col_bool_nullable" (array(array('1', true, null, 0.125, null, '0.1',...

While checking fields in the criteria of findBy and findOneBy functions works nicely, I notice mistyped field names in orderBy are being ignored. `$this->findBy([], ['dates' => 'desc']);` will happily pass...

With Doctrine ORM 3.4.0 [now](https://github.com/doctrine/orm/pull/11853) supporting native Lazy Objects introduced in PHP 8.4 there is no need for the EntityNotFinalRule anymore (introduced in https://github.com/phpstan/phpstan-doctrine/issues/202) The new functionality needs to be...