Re: [PHP-DEV] [RFC] Abstract final classes

2014-12-02 Thread Josh Watzman
On Nov 27, 2014, at 10:34 PM, Stanislav Malyshev wrote: >> You are correct. Methods cannot be declared abstract if you have an >> "abstract final". They must also be static. I added these checks together > > To me, it just feels a bit unnatural. So you have abstract class, which > usually has ab

Re: [PHP-DEV] [RFC] Abstract final classes

2014-11-27 Thread Stanislav Malyshev
Hi! > By forgetting "static" in any of your declared methods, you get no parse > error and gives you 2 possibilities: > - With E_STRICT enabled: Fatal error when non-static method is being > statically called. You'll only get this at runtime, leading to potentially > error prone. Now the testabili

Re: [PHP-DEV] [RFC] Abstract final classes

2014-11-27 Thread guilhermebla...@gmail.com
Ok... so if I update the RFC to be "static class", does that make everybody happy? I mainly wanna get this forward thinking trend... =) On Thu, Nov 27, 2014 at 10:49 AM, Rowan Collins wrote: > guilhermebla...@gmail.com wrote on 27/11/2014 15:34: > >> > This is true of classes intended to be stat

Re: [PHP-DEV] [RFC] Abstract final classes

2014-11-27 Thread Rowan Collins
guilhermebla...@gmail.com wrote on 27/11/2014 15:34: > This is true of classes intended to be static whether or not they are final. Allowing a "static class" would allow you to > enforce that all methods (and properties) must be static without banning users from extending it (which is a complete

Re: [PHP-DEV] [RFC] Abstract final classes

2014-11-27 Thread guilhermebla...@gmail.com
> This is true of classes intended to be static whether or not they are final. Allowing a "static class" would allow you to > enforce that all methods (and properties) must be static without banning users from extending it (which is a completely > orthogonal decision). So if I still want to not al

Re: [PHP-DEV] [RFC] Abstract final classes

2014-11-27 Thread Rowan Collins
guilhermebla...@gmail.com wrote on 27/11/2014 14:08: > In the RFC, I think one phrase needs clarification: > > Currently, PHP developers' only resource is to create a final class with > a private constructor, leading to untestable and error prone code. > > What is "error prone" in private __const

Re: [PHP-DEV] [RFC] Abstract final classes

2014-11-27 Thread guilhermebla...@gmail.com
> In the RFC, I think one phrase needs clarification: > > Currently, PHP developers' only resource is to create a final class with > a private constructor, leading to untestable and error prone code. > > What is "error prone" in private __construct(); and how the RFC improves > the testability of s

Re: [PHP-DEV] [RFC] Abstract final classes

2014-11-27 Thread Rowan Collins
guilhermebla...@gmail.com wrote on 27/11/2014 03:47: I worked on an implementation of a somehow controversial concept that exists in hack and C#: abstract final classes. https://wiki.php.net/rfc/abstract_final_class The explanation of what exactly has been implemented could perhaps be expande

Re: [PHP-DEV] [RFC] Abstract final classes

2014-11-27 Thread Ferenc Kovacs
On Thu, Nov 27, 2014 at 1:43 PM, Rowan Collins wrote: > Lazare Inepologlou wrote on 27/11/2014 10:35: > > 2014-11-27 4:47 GMT+01:00 guilhermebla...@gmail.com < >> guilhermebla...@gmail.com>: >> >> Hi, >>> >>> I worked on an implementation of a somehow controversial concept that >>> exists in ha

Re: [PHP-DEV] [RFC] Abstract final classes

2014-11-27 Thread Rowan Collins
Lazare Inepologlou wrote on 27/11/2014 10:35: 2014-11-27 4:47 GMT+01:00 guilhermebla...@gmail.com < guilhermebla...@gmail.com>: Hi, I worked on an implementation of a somehow controversial concept that exists in hack and C#: abstract final classes. https://wiki.php.net/rfc/abstract_final_clas

Re: [PHP-DEV] [RFC] Abstract final classes

2014-11-27 Thread Sebastian Krebs
Hi, 2014-11-27 4:47 GMT+01:00 guilhermebla...@gmail.com < guilhermebla...@gmail.com>: > Hi, > > I worked on an implementation of a somehow controversial concept that > exists in hack and C#: abstract final classes. > > https://wiki.php.net/rfc/abstract_final_class > > The example is a little bi

Re: [PHP-DEV] [RFC] Abstract final classes

2014-11-27 Thread Lazare Inepologlou
2014-11-27 4:47 GMT+01:00 guilhermebla...@gmail.com < guilhermebla...@gmail.com>: > Hi, > > I worked on an implementation of a somehow controversial concept that > exists in hack and C#: abstract final classes. > > https://wiki.php.net/rfc/abstract_final_class > > My motivation is to further expan

Re: [PHP-DEV] [RFC] Abstract final classes

2014-11-26 Thread Stanislav Malyshev
Hi! > I worked on an implementation of a somehow controversial concept that > exists in hack and C#: abstract final classes. > > https://wiki.php.net/rfc/abstract_final_class In the RFC, I think one phrase needs clarification: Currently, PHP developers' only resource is to create a final class

Re: [PHP-DEV] [RFC] Abstract final classes

2014-11-26 Thread Marco Pivetta
Except for the H1 on the RFC (needs to be updated), I can really see a lot of cases where I needed this: badly. On Nov 27, 2014 4:48 AM, "guilhermebla...@gmail.com" < guilhermebla...@gmail.com> wrote: > Hi, > > I worked on an implementation of a somehow controversial concept that > exists in hack