PSR-5 scope is phpDoc exclusively. It cannot affect types used for 
typecasting.

On Monday, August 1, 2016 at 6:32:45 PM UTC+3, Larry Garfield wrote:
>
> On 07/31/2016 02:03 PM, 'Alexander Makarov' via PHP Framework 
> Interoperability Group wrote:
>
> For the PSR-12 coding standard I've made a change that forces using short 
> form of type keywords i.e. bool instead of boolean, int instead of integer 
> etc.: 
>
>
> https://github.com/php-fig/fig-standards/commit/a77993bdf52eb6d5cb9ca37dba3af4df9e3b909c
>
> As Michael Cullum pointed out, I was too fast and it should be discussed. 
> I need your answers for the following questions:
>
> 1. If this additional rule makes sense?
> 2. What possible drawbacks are there?
>
> *Why was the change made*
>
> PHP 7.0 introduced scalar types declaration 
> <http://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration>
>  
> which does not support long type aliases. Therefore it makes sense to 
> enforce primary short type forms to be used to have uniform syntax and 
> prevent possible confusion.
>
> *Counter-agruments from Michael*
>
> This could conflict with other PSRs like PSR-5 and seems out of scope of 
>> this PSR to be honest.
>
>
> I fully agree with the policy.  With PHP 7 using only short-versions for 
> types it makes sense for everything else to follow that as well.
>
> However, I'm sympathetic to the scope question.  It does seem more like 
> PSR-5's responsibility.  PSR-5 isnt' finalized (and is currently fallow), 
> so it's not binding on anything.
>
> I guess I could go either way here, although unless PSR-12 considers 
> coding style within docblocks generally to be in scope (I don't think it 
> does?) I'd probably agree with Michael and remove it.  Whenever PSR-5 gets 
> reactivated that change should be made there instead.
>
> --Larry Garfield
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/e0e682fe-10b4-4ca5-893c-28f103b14409%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • [PSR-12] Enfo... 'Alexander Makarov' via PHP Framework Interoperability Group
    • Re: [PSR... Woody Gilk
    • Re: [PSR... Marc Alexander
    • Re: [PSR... Larry Garfield
      • Re: ... 'Alexander Makarov' via PHP Framework Interoperability Group
        • ... Michael Cullum
          • ... 'Alexander Makarov' via PHP Framework Interoperability Group
            • ... Korvin Szanto
            • ... Michael Cullum
              • ... 'Alexander Makarov' via PHP Framework Interoperability Group

Reply via email to