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

# Bug report With lastest Phpstan version, on an up-to-date Symfony 6.2/PHP 8.1 project, I run: `php -d memory_limit=-1 vendor/bin/phpstan analyse src --level=5 -v` It says me : ` Post...

``Consider having a BackendEnum class FooEnum. The entity class has following property declaration: ``` #[ORM\Column(name: 'type', nullable: false, enumType: FooEnum::class)] private FooEnum type; ``` When running PHPStan analysis, it fails...

I am using doctrine/orm 2.14.1 and even though https://github.com/phpstan/phpstan-doctrine/issues/393 mentions it being fixed I think this was only for setLockMode. Repro: ``` ->getQuery() ->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true) ->getOneOrNullResult(AbstractQuery::HYDRATE_OBJECT); ``` Dumped type: mixed...

Currently, the resolution of doctrine types considers that any field that uses `enumType` will have a PHP type of `new ObjectType($enumType)` (potentially nullable depending on the nullability of the field)....

Hi! In the case of SINGLE TABLE INHERITANCE the doctrine documentation states that: > For Single-Table-Inheritance to work in scenarios where you are using either a legacy database schema or...

Right now, the phpstan-doctrine extension is able to validate that common loading patterns (findBy and friends) are only passed mapped columns, which is awesome and has saved me from more...

Regarding https://github.com/phpstan/phpstan-doctrine/issues/66 and solution for it https://github.com/phpstan/phpstan-doctrine/pull/140 Issue description obviously produces expectation that solution would let you validate query builders created using (1)`RepositoryClass::createQueryBuilder` as a common use case, and not...

Forgetting to add an index is very common, and when that happens, we usually don't notice that until the app is already long in production. I propose creating a PHPstan...

The `simple_array` type converts `NULL` database values to an empty array: https://github.com/doctrine/dbal/blob/3.6.1/src/Types/SimpleArrayType.php#L53-L57 This means that a nullable column does not mean that the PHP property needs to be nullable. This...

When a field is defined as `simple_array`: ```php #[ORM\Column(type: Types::SIMPLE_ARRAY, length: 255, nullable: true)] private array $foo = []; ``` ... then using it in a Query Builder like this...