I agree with Adam, I think it would be nice to let the trait contain its own
properties which can then be overwritten by the class properties.

This way we could include default properties that the trait may be dependent
on, while providing the opportunity to override individual properties to
provide a specific reaction for the class the trait is used in.

Just curious, if the trait property is set to private what happens?

- Mike



On Fri, Jul 22, 2011 at 11:18 AM, Adam Harvey <ahar...@php.net> wrote:

> On 22 July 2011 09:12, Alex Howansky  wrote:
> >
> >> That makes sense if it would overwrite the methods as well, but
> >> otherwise it seems like it provides inconsistent functionality.
> >
> > Exactly. At the least, it's inconsistent. If it's a bug, then it seems
> the
> > question becomes:
> >
> > Is the bug this:
> >
> > "Properties defined in a trait should be overridden by same-named
> properties
> > defined in a class that use the trait."
> >
> > Or (as pointed out by Anthony) this:
> >
> > "You shouldn't be able to define properties in a trait."
>
> Traits definitely need to be able to support properties, IMO, so I'd
> say that the first behaviour just needs to be documented (and
> potentially a notice added). Either the trait or the class is going to
> have its property overwritten, so we should pick which definition wins
> and go from there.
>
> Adam
>
>

-- 
-----------------------

"My command is this: Love each other as I
have loved you."                         John 15:12

-----------------------

Reply via email to