Ah, didn't know about PSR-12. Looks good and indeed contemplates my use
case very thoroughly.

On Fri, Feb 2, 2018 at 3:43 PM, Alessandro Lai <alessandro.la...@gmail.com>
wrote:

> You should take a look at PSR-12, which is in review right now:
> https://github.com/php-fig/fig-standards/blob/master/
> proposed/extended-coding-style-guide.md
>
> Il giorno venerdì 2 febbraio 2018 21:05:38 UTC+1, Julian Vidal ha scritto:
>>
>> I write my projects using PSR-2 enforced by my IDE (PhpStorm) and have
>> phpcs constantly in the background too. While working today, I found
>> something odd that I would like to discuss in this list.
>>
>> I wrote this:
>>
>> use App\Services\AuditTrail\Actions\{
>>     ModelPreUpdate,
>>     ModelPostUpdate,
>>     ModelCreated,
>>     ModelDeleted
>> };
>>
>> But phpcs complains that according to PSR-2 I should use this:
>>
>> use App\Services\AuditTrail\Actions\ModelPreUpdate;
>> use App\Services\AuditTrail\Actions\ModelPostUpdate;
>> use App\Services\AuditTrail\Actions\ModelCreated;
>> use App\Services\AuditTrail\Actions\ModelDeleted;
>>
>> I looked it up on the PHP-FIG website
>> <https://www.php-fig.org/psr/psr-2/#3-namespace-and-use-declarations>
>> and indeed phpcs was right.
>>
>> Is there a particular reason for this? Seems to me the group use
>> declarations are much more readable and shorter to write/read.
>> Or is this maybe something that was decided pre PHP7 when group use
>> declarations didn't exist?
>>
>> Just curious to know...
>> Cheers!
>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "PHP Framework Interoperability Group" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/php-fig/vatmISyTjjY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> php-fig+unsubscr...@googlegroups.com.
> To post to this group, send email to php-fig@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/php-fig/2e99d6cd-8973-4872-af52-7c9cf7b0d111%40googlegroups.com
> <https://groups.google.com/d/msgid/php-fig/2e99d6cd-8973-4872-af52-7c9cf7b0d111%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "PHP 
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to php-fig+unsubscr...@googlegroups.com.
To post to this group, send email to php-fig@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/CALCkgPmgCS%3DRVkkJGshsnLEd9b8a3KiAk_fUx0%2B4VqzyU6Ngxw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to