1

I've seen a lot of posts talking about why alternative Syntax in PHP is good/bad.

It's not the topic, I'm a convention lover and I want to know if there's about convention about it. Have a clean code is one of my priority.

I'm pretty sure it's not a duplicate question but tell me if it's.

1 Answers1

-1

You can see all of the PSR recommendations at http://www.php-fig.org/.

The two PSR's concerning 'syntax' are

delboy1978uk
  • 12,118
  • 2
  • 21
  • 39
  • 2
    And I've seen nothing about alternative syntax. It seem strange that there's no best practice or something else about it – Valentin Silvestre Sep 27 '17 at 09:21
  • I'm using PHP-CS-FIXER and it applies PSR1 + PSR2 and it notice nothing. – Valentin Silvestre Sep 27 '17 at 09:23
  • So you are already coding to the standard? In PHP Storm, I just select all and CTRL-ALT-L and it formats it compliantly where it can. Follow those two rules though and you'll be alright, employers love seeing PSR compliant on your CV! – delboy1978uk Sep 27 '17 at 09:24
  • CTRL+ALT+L isn't PSR compliant. I'm using it then php cs fixer and it change everytime. In both way. I'm using phpstorm too ofc :) – Valentin Silvestre Sep 27 '17 at 09:31
  • 1
    yeah, like i say, *where it can*, it wont rename `snake_cased_method()` to camelCase for instance! – delboy1978uk Sep 27 '17 at 09:52