Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Narrow down driver return types #4926

Merged
merged 1 commit into from
Oct 24, 2021

Conversation

derrabus
Copy link
Member

Q A
Type improvement
BC Break no
Fixed issues N/A

Summary

On PHP 7.4, we can make use of covariance to be more specific about the return types of Driver, Connection and Statement classes.

Signed-off-by: Alexander M. Turek <[email protected]>
@derrabus derrabus added this to the 4.0.0 milestone Oct 24, 2021
@morozov
Copy link
Member

morozov commented Oct 24, 2021

This is a good point. We should be able to apply this approach in some more cases:

/**
* @return T
*/
abstract public function createPlatform(): AbstractPlatform;

@derrabus derrabus merged commit 74ba4d5 into doctrine:4.0.x Oct 24, 2021
@derrabus derrabus deleted the improvement/narrow-return-types branch October 24, 2021 18:12
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants