Skip to content

[REQ] PHP Client/Server class property types #5349

Open
@xvilo

Description

@xvilo

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

Currently, PHP 7.4 has support for typed properties (see this RFC: https://wiki.php.net/rfc/typed_properties_v2). I think we should support this behind a feature flag.

Describe the solution you'd like

Add types to class properties, as we have them already as method arguments.

Additional context

This could be added for the following generators:

  • clients
    • php (Guzzle)
  • servers
    • PHP Laravel
    • PHP Lumen
    • PHP Slim
    • PHP Symfony
    • PHP Zend Expressive (with Path Handler)

I could create this functionality for the Symfony Server if this is wanted, for the others I would hope others could contribute to this.

As an example, the current model output for the PHP Symfony server is:
Screenshot 2020-02-17 at 16 37 37

What it could become afterward:
Screenshot 2020-02-17 at 16 37 53

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions