Hi Matthew,

In this specific case (when considering an interface), @return self is
wrong, as there is no way to return purely an interface instance. You just
can't instantiate an interface.

However, we should never assume that @return self is wrong in all
scenarios, and IDEs should make sure that overriding it is not wrong.
Conceptually, I can have a @return static in an interface, but the
implementation overrides it to be @return self. This is needed in the case
we're doing something like this:

interface Factory {
    /**
     *@return static
     */
    function create();
}

class BarFactory implements Factory {
    /**
     *@return self
     */
    public function create() {
        return new self(); // Yes, create the Factory as an instance for
demonstration purposes... =)
    }
}

Cheers,

On Wed, Aug 3, 2016 at 3:10 PM, Paul Jones <pmjone...@gmail.com> wrote:

>
> > On Aug 3, 2016, at 13:54, Matthew Weier O'Phinney <
> mweierophin...@gmail.com> wrote:
> >
> > is such a change
> > considered a *fix* (because it updates the syntax to match intent) or a
> > *clarification* (which would require a vote)?
>
> IMO that's a fix; no vote needed.
>
>
> --
>
> Paul M. Jones
> http://paul-m-jones.com
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "PHP Framework Interoperability Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to php-fig+unsubscr...@googlegroups.com.
> To post to this group, send email to php-fig@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/php-fig/F92B068D-C3BD-4FC6-88F9-5AA9C38D2821%40gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Guilherme Blanco
Lead Architect at E-Block

-- 
You received this message because you are subscribed to the Google Groups "PHP 
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to php-fig+unsubscr...@googlegroups.com.
To post to this group, send email to php-fig@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/CAFp73XsRhtqH7nyHF983XpmavpaHvD5RTL60c5TwSAXf%2BfJjCg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to