Re: [RFC][Draft] Body-less __construct

From: Date: Tue, 11 May 2021 15:07:04 +0000
Subject: Re: [RFC][Draft] Body-less __construct
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-114397@lists.php.net to get a copy of this message
Le 10/05/2021 à 18:58, Larry Garfield a écrit :
I agree that in the grand scheme of things this would be a minor matter, but aesthetically I would prefer it as well. The {} annoys me, CS tools or no. Related: I feel the same way about empty-classes and interfaces, which is often the case for exceptions where all you're doing is declaring a type. I figure that would get even more pushback, though. :-) As a data point, you can already do the same "semi-colon for no body" for foreach, for, and while loops. I've only ever done it on foreach to runout an iterator, but it works on all three today. --Larry Garfield
I didn't saw this answer at first, but I agree that:
interface MyLibraryException;


class DefaultMyLibraryException extends \RuntimeException implements MyLibraryException;

Is an excellent use case for this! Regards, Pierre

« previous php.internals (#114397) next »