Re: [PHP-DEV] Decorator classes

2016-12-29 Thread Marco Pivetta
On Thu, Dec 29, 2016 at 3:27 PM, Mathieu Rochette wrote: > yeah it's mostly syntactic sugar, I think it would encourage developer to > use this pattern instead of inheritance when appropriate. > I also think that most of the time using the decorator pattern helps > following the single responsibi

Re: [PHP-DEV] Decorator classes

2016-12-29 Thread Mathieu Rochette
On 29/12/2016 14:18, Marco Pivetta wrote: On Thu, Dec 29, 2016 at 2:12 PM, Mathieu Rochette > wrote: Hello internals, I find that using the decorator pattern is very verbose and maybe something could be done about that, an article[1] I saw propose

Re: [PHP-DEV] Decorator classes

2016-12-29 Thread Mathieu Rochette
On 29/12/2016 14:44, Alexander Lisachenko wrote: 2016-12-29 16:12 GMT+03:00 Mathieu Rochette >: I find that using the decorator pattern is very verbose and maybe something could be done about that, an article[1] I saw proposed a "decorates" keyword to

Re: [PHP-DEV] Decorator classes

2016-12-29 Thread Alexander Lisachenko
2016-12-29 16:12 GMT+03:00 Mathieu Rochette : > I find that using the decorator pattern is very verbose and maybe > something could be done about that, > an article[1] I saw proposed a "decorates" keyword to solves this, here is > how it might look like in PHP: > > * the constructor is optional

Re: [PHP-DEV] Decorator classes

2016-12-29 Thread Marco Pivetta
On Thu, Dec 29, 2016 at 2:12 PM, Mathieu Rochette wrote: > Hello internals, > > I find that using the decorator pattern is very verbose and maybe > something could be done about that, > an article[1] I saw proposed a "decorates" keyword to solves this, here is > how it might look like in PHP: > >

[PHP-DEV] Decorator classes

2016-12-29 Thread Mathieu Rochette
Hello internals, I find that using the decorator pattern is very verbose and maybe something could be done about that, an article[1] I saw proposed a "decorates" keyword to solves this, here is how it might look like in PHP: interface Foo { public bar(); public taz(); } class EchoFooBar