Re: [PHP-DEV] Discussion Short Constructor

2025-07-24 Thread Paul M. Jones
Hi Dmitry, > On Jul 24, 2025, at 12:41, Dmitry Derepko wrote: > > Good catch for multi-classes per file with such feature, but I think it's not > the time to do it. ... > I think we should discuss the idea of the Short Constructor here. At least it > does not require autoloading changes Not

Re: [PHP-DEV] Discussion Short Constructor

2025-07-24 Thread Dmitry Derepko
Good catch for multi-classes per file with such feature, but I think it's not the time to do it. As an alternative way to find the class is to look at the all files in the namespace: src/App/Controller/ IndexController.php BlogController.php IndexController.php contains ``` namespace

Re: [PHP-DEV] Discussion Short Constructor

2025-07-16 Thread Paul M. Jones
Hi all, > On Jul 16, 2025, at 11:40, Deleu wrote: ... > The blessing and the curse of PSR-4 is that it spoiled us (or maybe just me?) > to: > > - never think about `require/include` > - never think about composer.json > - never think about how classes/interfaces/traits are located > - IDEs wi

Re: [PHP-DEV] Discussion Short Constructor

2025-07-16 Thread Rob Landers
On Wed, Jul 16, 2025, at 17:44, Deleu wrote: > > > On Wed, Jul 16, 2025 at 3:49 AM Rob Landers wrote: >> __ >> >> Why I haven't proposed it as a separate RFC: with PSR-4 being so popular, >> nobody is going to write one-line files to take advantage of this. Thus, >> when I was going to revisi

Re: [PHP-DEV] Discussion Short Constructor

2025-07-16 Thread Deleu
On Wed, Jul 16, 2025 at 12:59 PM Larry Garfield wrote: > > I will reiterate what I have said many times in the context of function > autoloading: > > The only autoloader that really matters in practice is Composer. > > Composer supports "front-load this list of files". You can put whatever > you

Re: [PHP-DEV] Discussion Short Constructor

2025-07-16 Thread Larry Garfield
On Wed, Jul 16, 2025, at 10:44 AM, Deleu wrote: > On Wed, Jul 16, 2025 at 3:49 AM Rob Landers wrote: >> __ >> >> Why I haven't proposed it as a separate RFC: with PSR-4 being so popular, >> nobody is going to write one-line files to take advantage of this. Thus, >> when I was going to revisit n

Re: [PHP-DEV] Discussion Short Constructor

2025-07-16 Thread Deleu
On Wed, Jul 16, 2025 at 3:49 AM Rob Landers wrote: > > Why I haven't proposed it as a separate RFC: with PSR-4 being so popular, > nobody is going to write one-line files to take advantage of this. Thus, > when I was going to revisit nested classes later this year (after all the > release shenani

Re: [PHP-DEV] Discussion Short Constructor

2025-07-15 Thread Rob Landers
On Tue, Jul 15, 2025, at 20:07, Dmitry Derepko wrote: > Hi, > > I've found a discussion about Records https://externals.io/message/125975 and > found a one key point which I really like in Kotlin (hello): short > constructors. > > Rob said that short constructor will be probably removed: >> 1.

Re: [PHP-DEV] Discussion Short Constructor

2025-07-15 Thread Larry Garfield
On Tue, Jul 15, 2025, at 1:07 PM, Dmitry Derepko wrote: > Hi, > > I've found a discussion about Records > https://externals.io/message/125975 and found a one key point which I > really like in Kotlin (hello): short constructors. > > Rob said that short constructor will be probably removed: >> 1.