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

According to https://github.com/phpstan/phpstan-doctrine/blob/90e60ba9dbea4b29c7b87026a29e91ac0a02674e/src/Type/Doctrine/Query/QueryResultDynamicReturnTypeExtension.php#L117-L127, `QueryBuilder::getResult` returns an array withh all returned types, and does not preserve order. As an example, we had this code: ```php /* * @return array{ 0: SearchCustomization...

### Bug report Here is an example of what I am seeing. It is incorrect on all counts. ``` ------ ------------------------------------------------------------------------------------------------------------- Line src/App/Repository/AbstractEntityRepository.php ------ ------------------------------------------------------------------------------------------------------------- 19 QueryBuilder: [Semantical Error] line...

### Bug report This indicates an error in _my_ code, but the crash is unexpected. I'm providing the bug report and stack trace as the PHPStan output requests, but through...

Same as https://github.com/phpstan/phpstan-doctrine/pull/453#issue-1695849185 With the commit https://github.com/phpstan/phpstan-doctrine/commit/1b0a1b09da00f3acabc3873460d34b514461d7ab I changed the strategy to be easily accepted and then easier to merge: - If I can precisely infer the type, I return...

Currently, when a file [is not among "analysed files"](https://github.com/phpstan/phpstan-src/blob/1.10.47/src/Parser/PathRoutingParser.php#L44) (which is any file not listed in partial analysis), every method body is [stripped by CleaningParser](https://github.com/phpstan/phpstan-src/blob/1.10.47/src/Parser/CleaningVisitor.php#L29). Due to that [OtherMethodQueryBuilderParser](https://github.com/phpstan/phpstan-doctrine/blob/1.3.53/src/Type/Doctrine/QueryBuilder/OtherMethodQueryBuilderParser.php#L95) cannot...

refs. https://github.com/phpstan/phpstan-src/pull/181

With this entity: ``` #[Entity] class Person { #[Id] #[Column(type: "integer")] public int $id; public static function getQb(EntityManager $em): QueryBuilder { return $em->createQueryBuilder() ->select('p') ->from(self::class, 'p'); } } ``` And...