Hi Liam, We discussed alternative control syntax at least once[0] (I recall a few times) and decided that we wanted to leave them unspecified for fear of needing to codify mixed PHP and HTML where they are primarily used. That says PSR-12 specifically requires control structures use brackets in the section you quoted but there's nothing stopping you from using PSR-12 and allowing them in your own projects.
[0] https://groups.google.com/g/php-fig/c/q5B_f0WQsOA/m/vC5ZpV5CBwAJ?utm_medium=email&utm_source=footer Best wishes, Korvin On Thu, Jul 15, 2021, 2:20 PM Liam Hennessy <[email protected]> wrote: > Greetings! > > According to Section 5 of PSR-12 <https://www.php-fig.org/psr/psr-12/> > (Control > Structures): > > *The body of each structure MUST be enclosed by braces. This standardizes > how the structures look and reduces the likelihood of introducing errors as > new lines get added to the body.* > > Does this mean that *endif, endwhile, endfor, endforeach, *and *endswitch* > are not permitted by PSR-12? > > It would be helpful if PSR-12 was more explicit about this, even if the > consensus is that you MAY use them, as it is easy to overlook this point > completely or misinterpret this point as a strict exclusion. > > As a new member, please accept my thanks for your time and effort. > > Regards, > > Liam > > -- > 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 view this discussion on the web visit > https://groups.google.com/d/msgid/php-fig/f0d9e0c7-9957-45fe-9721-5d3e2f71b613n%40googlegroups.com > <https://groups.google.com/d/msgid/php-fig/f0d9e0c7-9957-45fe-9721-5d3e2f71b613n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CANeXGWU7bSrjxQpo3QtKe%3DyT%3DVgUm6wijNAcTK-MH8H%3DwZ6UQw%40mail.gmail.com.
