glpi-project / docdev

Documentation for glpi developpers
http://glpi-developer-documentation.rtfd.io/
Other
27 stars 34 forks source link

Coding Standards (proposal) #62

Closed DIOHz0r closed 6 months ago

DIOHz0r commented 7 years ago

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

trasher commented 6 years 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

tomolimo commented 6 years ago

me too :smile:

AnaelMobilia commented 5 years ago

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

trasher commented 6 months ago

GLPI CS now relies on PSR