Closed DIOHz0r closed 6 months ago
GLPI historically uses its own coding standards... The very first step was to automatize their checkings; which is done now.
I would agree to use a most common standard
me too :smile:
Just to backport @trasher comment on https://github.com/glpi-project/glpi/issues/3366#issuecomment-469994590
Work has begun on master. To make things simplier, and stay compatible with 9.4 as long as possible, we've decided not to switch to PSR for all current codebase, but only for new classes in the src directory.
Maybe update docdev including this information ? (eg : "New classes should respect PSR-2 standards, but isn't mandatory for historical code").
Regards, Anael
GLPI CS now relies on PSR
I was reading documentation about coding standards (http://glpi-developer-documentation.readthedocs.io/en/master/codingstandards.html), but some of your standards aren't following some of the PSR (http://www.php-fig.org/) which are used by a lot of open source projects.
The idea of this issue is to discuss about change the standards or at least start applying PSR-1 and PSR-2 to this project, all this in benefit of let know all developers and community about this standards used by many open source projects and frameworks, make this project another reference of good practices and follower of standards and maybe you can contribute to other PSR draft.
You can use the PHP-CS-Fixer tool (https://github.com/FriendsOfPHP/PHP-CS-Fixer) to apply those standards with out a problem and add it to a Text Editor, IDE, Git hook or C.I. to fix all code committed