ILIAS icon indicating copy to clipboard operation
ILIAS copied to clipboard

Docs: update coding style

Open klees opened this issue 3 years ago • 1 comments

Hi everyone,

I hereby propose to update our coding-style definition slightly:

  • Update from PSR-2 to PSR-12. A lot of new PHP-stuff hasn't been adressed in PSR-2.
  • Hence, remove definitions that are covered by PSR-12.
  • Change return type declaration style from method() : return_type to method(): return_type to make our style match PSR-12.
  • Unrelated: make underscore_case mandatory for variable and property names, there hasn't been any convention here until now.

If this is accepted, we'll need to adjust our tooling accordingly and most likely will have another commit to rectify the codebase. I'm confident that the TB will fund these changes. I would propose to only apply this to ILIAS 8 and future versions, since ILIAS 7 will already look vastly different then ILIAS 8 due to the PHP 8-project, hence no immediate benefit to retrofit this change.

Best regards!

klees avatar May 13 '22 11:05 klees

Jour Fixe, 16 MAY 2022 : We highly appreciate this suggetion and accept the change of the guideline from PSR-2 to PSR-12, incl. the above mentioned handling of variable and property names. @klees will change the related tooling and notify of the change via dev list. In case of issues, please discuss this as dev issue in the next JF.

matthiaskunkel avatar May 16 '22 12:05 matthiaskunkel