Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #4726
Closed
Open
Issue created Dec 08, 2019 by Administrator@rootContributor1 of 3 checklist items completed1/3 checklist items

[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

  1. Change PHP style guide link at Guidelines For Contributing to PSR-12 Extended Style Guide
  2. All PHP generators which follow PSR-2 coding guide should follow new rules from PSR-12. Tool PHP_CodeSniffer already supports PSR-12 ruleset from 3.5.0 version. If your generator contains PHP_CodeSniffer package then migrate to ^3.5 version and use ruleset like phpcs --standard=PSR12 /path/to/code(or adjust phpcs.xml in your template).
  3. 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)

Assignee
Assign to
Time tracking