Skip to content
This repository has been archived by the owner on Nov 23, 2017. It is now read-only.

Altered return hinting #35

Merged
merged 1 commit into from
Sep 2, 2014
Merged

Altered return hinting #35

merged 1 commit into from
Sep 2, 2014

Conversation

rdohms
Copy link
Contributor

@rdohms rdohms commented Sep 2, 2014

Since this method can be invoked form a child class, the return type of "AbstractUrl" does not allow the IDE to provide proper autocomplete of the Url or UrlImmutable classes.

By returning static IDEs can figure this out from the invoke context, as well as it indicating that this class can be invoked form children.

Since this method can be invoked form a child class, the return type of "AbstractUrl" does not allow the IDE to provide proper autocomplete of the Url or UrlImmutable classes.

By returning `static` IDEs can figure this out from the invoke context, as well as it indicating that this class can be invoked form children.
@frankdejonge
Copy link
Member

Thanks @rdohms 👍

@nyamsprod: This is something I've fixed in a couple of places recently, a good one to keep in the back of your mind. Static allows for late static binding, an abstract class or trait can never be instantiated, so can never be the return-type.

nyamsprod added a commit that referenced this pull request Sep 2, 2014
@nyamsprod nyamsprod merged commit 415ed83 into thephpleague:master Sep 2, 2014
@rdohms rdohms deleted the patch-1 branch September 2, 2014 14:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants