[PR #6440] Initial PHPStan integration #9983

Open
opened 2026-01-22 16:06:03 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/6440

State: closed
Merged: No


This is a starting point to begin using static analysis in Doctrine ORM codebase. PHPStan is already used by doctrine/common and doctrine/annotations so I think it's logical that the ORM repo starts using it too :)

The build will now fail, I wasn't sure what to do about this one error:

 ------ ------------------------------------------------------------------------------------------
  Line   lib/Doctrine/ORM/Query/ResultSetMapping.php
 ------ ------------------------------------------------------------------------------------------
  456    Return typehint of method Doctrine\ORM\Query\ResultSetMapping::getRelation() has invalid
         type Doctrine\ORM\Query\AssociationMapping.
 ------ ------------------------------------------------------------------------------------------

The method has no tests and no usage in the project, so I'm really not sure what it's supposed to return.

After you merge this, I can spread the analysis to tests and also increase the level of the analysis to find more errors.

**Original Pull Request:** https://github.com/doctrine/orm/pull/6440 **State:** closed **Merged:** No --- This is a starting point to begin using static analysis in Doctrine ORM codebase. [PHPStan](https://github.com/phpstan/phpstan) is already used by doctrine/common and doctrine/annotations so I think it's logical that the ORM repo starts using it too :) The build will now fail, I wasn't sure what to do about this one error: ``` ------ ------------------------------------------------------------------------------------------ Line lib/Doctrine/ORM/Query/ResultSetMapping.php ------ ------------------------------------------------------------------------------------------ 456 Return typehint of method Doctrine\ORM\Query\ResultSetMapping::getRelation() has invalid type Doctrine\ORM\Query\AssociationMapping. ------ ------------------------------------------------------------------------------------------ ``` The method has no tests and no usage in the project, so I'm really not sure what it's supposed to return. After you merge this, I can spread the analysis to tests and also increase the level of the analysis to find more errors.
admin added the pull-request label 2026-01-22 16:06:03 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#9983