[PR #8544] Add type declarations where backwards-compatible #11058

Closed
opened 2026-01-22 16:09:34 +01:00 by admin · 0 comments
Owner

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

State: closed
Merged: Yes


This includes:

  • private methods
  • return type declarations of final protected methods
  • return type declarations of public and protected methods of final classes

Parameter type declarations are a more delicate matter and should
probably be handled separately to make it easier to catch issues during
code review.

Type declarations can be more trusted than simple phpdoc when it
comes to static analysis, having them means we can infer the phpdoc of
calling methods with confidence.

Note that it seems that some of the phpdoc I initially inferred these
declarations from were apparently wrong, in particular some mentioning
Doctrine\Dbal\Statement when was is really passed around is
Doctrine\Dbal\Driver\Statement.

Closes #8538

**Original Pull Request:** https://github.com/doctrine/orm/pull/8544 **State:** closed **Merged:** Yes --- This includes: - private methods - return type declarations of final protected methods - return type declarations of public and protected methods of final classes Parameter type declarations are a more delicate matter and should probably be handled separately to make it easier to catch issues during code review. Type declarations can be more trusted than simple phpdoc when it comes to static analysis, having them means we can infer the phpdoc of calling methods with confidence. Note that it seems that some of the phpdoc I initially inferred these declarations from were apparently wrong, in particular some mentioning `Doctrine\Dbal\Statement` when was is really passed around is `Doctrine\Dbal\Driver\Statement`. Closes #8538
admin added the pull-request label 2026-01-22 16:09:34 +01:00
admin closed this issue 2026-01-22 16:09:35 +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#11058