Hi Marco,

Comments inline.

On Thu, Mar 9, 2017 at 10:40 PM, Marco Perone <[email protected]> wrote:

> As per PSR-1 specifications, class names must be in StudlyCaps.
>
>
> However, if I want to define a class named Echo (or any other Php
> keyword), I am not able to do that beacuse if I do so I obtain a parse
> error.
>
>
> It seems that the standard solution to this issue is to add an _ at the
> end of the class, as in Echo_.
>

No, this is not the standard solution.


> For example, look in https://github.com/nikic/PHP-Parser/tree/3.x/lib/
> PhpParser/Node/Stmt.
>

This would not pass PSR-1 codesniffer tests.

>
> Should this be counted as a violation of PSR-1?
>
> Could it be the case to state this explicitely in PSR-12, allowing the
> presence of a final underscore in a class name, maybe only when the class
> name in a reserved keyword?
>
>
> Where possible you should avoid naming your classes after language
constructs and tokens.


> More broadly, could it be the case to provice a precise definition of what
> StudlyCaps mean? (If it's not present elsewhere and I'm missing it...)
>
> --
> 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/e07dbe3c-2488-4630-8850-bdb04ccae52b%40googlegroups.com
> <https://groups.google.com/d/msgid/php-fig/e07dbe3c-2488-4630-8850-bdb04ccae52b%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 [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/CAKxcST_xhaRhpnn8jV8jVDRQXMO4c98%2BN3HsV3d3mJ-Zyri%2BhQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to