[REQ][PHP] Follow PSR-12 Coding Style Guide
Created by: ybelenko
Is your feature request related to a problem? Please describe.
From PSR-2 Coding Style Guide:
Deprecated - As of 2019-08-10 PSR-2 has been marked as deprecated. PSR-12 is now recommended as an alternative.
Describe the solution you'd like
-
Change PHP style guide link at Guidelines For Contributing to PSR-12 Extended Style Guide -
All PHP generators which follow PSR-2coding guide should follow new rules fromPSR-12. ToolPHP_CodeSnifferalready supportsPSR-12ruleset from3.5.0version. If your generator containsPHP_CodeSnifferpackage then migrate to^3.5version and use ruleset likephpcs --standard=PSR12 /path/to/code(or adjustphpcs.xmlin your template). -
Adjust all other PHP linters and prettifiers to follow PSR-12.
Additional context
Question to PHP members of technical committee:
As soon as required PHP version is 7.1 or higher should we add type annotations to PHP templates? I mean int $bar = 0;
cc @jebentier (2017/07), @dkarlovi (2017/07), @mandrean (2017/08), @jfastnacht (2017/09), @ackintosh (2017/09), @renepardon (2018/12)