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
  • #12771
Closed
Open
Issue created Jul 05, 2022 by Administrator@rootContributor

[REQ][php] declareStrictTypes option for all PHP generators

Created by: ybelenko

Is your feature request related to a problem? Please describe.

Usually I totally against codegen options which modifies one line of code, but this one looks really handy.

Describe the solution you'd like

Add declareStrictTypes switch option to AbstractPhpCodegen class, then:

openapi-generator-cli generate -g php --additional-properties=declareStrictTypes=true \
    -o out -i petstore.yaml

then in all mustache files:

<?php 

{{#declareStrictTypes}}declare(strict_types=1);{{/declareStrictTypes}}

We also need to decide whether this switch option should be on or off by default. I think it should be on, but it can cause breaking changes.

Describe alternatives you've considered

Close this issue as not necessary feature 😆

Additional context

cc @jebentier @dkarlovi @mandrean @jfastnacht @renepardon

Assignee
Assign to
Time tracking