2
Nov 06 '16
You can choose between PSR-0, PSR-1 and PSR-2?
That doesn't make much sense. PSR-0 is an autoloading standard, and PSR-1 and PSR-2 are not alternative standards, they're two parts of the same FIG coding standard.
4
u/jyggen Nov 06 '16
The site probably uses PHP-CS-Fixer to "fix" the code, which categorize its fixers into the levels PSR-0, PSR-1, PSR-2, symfony and contrib.
0
u/SirMuttley Nov 06 '16 edited Nov 06 '16
Personally I prefer teaching people to write code that matches the standard you use rather than relying on "fixer" tools
Edit just to clarify I understand people might want to use this for reformatting their older code into a new standard, but I think relying on this day to day is a problem.
I chatted to a guy this week who told me at their company they have a script that will run cs fixer automatically on everything that gets committed.
3
u/eigan Nov 06 '16
Or just use the tool which probably has plugin to your editor.. https://github.com/FriendsOfPHP/PHP-CS-Fixer