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

Sync with php-fig/http-message#50 #793

Merged
merged 1 commit into from Aug 5, 2016

Conversation

weierophinney
Copy link
Contributor

This patch updates PSR-7 to always use @return static instead of @return self within method annotations, as done in php-fig/http-message#50. Per the discussion on that issue, static is interpreted by phpDoc and most IDEs in such a way that it always resolves to the class against which it was invoked, and not the defining class, unlike self, which always resolves to the class in which it was originally defined. Additionally, static has the connotation that a new instance, not the same instance, will be returned — which is the intention as outlined already in each method providing such a return value.

@michaelcullum
Copy link
Member

This now has conflicts, sorry @weierophinney

This patch updates PSR-7 to always use `@return static` instead of `@return self`
within method annotations, as done in php-fig/http-message#50. Per the
discussion on that issue, `static` is interpreted by phpDoc and most IDEs in
such a way that it always resolves to the class against which it was invoked,
and not the defining class, unlike `self`, which always resolves to the class in
which it was originally defined. Additionally, `static` has the *connotation*
that a new instance, not the same instance, will be returned — which is the
intention as outlined already in each method providing such a return value.
@weierophinney
Copy link
Contributor Author

@michaelcullum I've rebased and re-pushed now.

@michaelcullum
Copy link
Member

Thanks. I'll merge this and the other tomorrow pending no objections.

@michaelcullum michaelcullum merged commit ae54b11 into php-fig:master Aug 5, 2016
@weierophinney weierophinney deleted the hotfix/http-message-50 branch August 5, 2016 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants