OpenAPITools / OpenAPITools/openapi-generator
[REQ][PHP] Follow PSR-12 Coding Style Guide
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with CONTRIBUTING.md and inventory the PHP generators for PHP_CodeSniffer packages, PSR-2 references, and any phpcs.xml files or other linter configurations mentioned in the issue. The work is done when the applicable PHP generators and linters consistently use PSR-12 rules; the question about adding type annotations remains separate and unresolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100