Skip to content

[REQ][php] Add config option to generate API interfaces #17531

Open
@ybelenko

Description

@ybelenko

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

It would be good to have an option to generate interfaces at least for API classes. That's related to all current PHP clients. Modern PHP development use interfaces as typehints instead of precise class names because it gives more flexibility with dependency autowiring.

Describe the solution you'd like

When generator config option includeInterfaces=true then output contains interface for each API class, like UsersApi -> UsersApiInterface.

Describe alternatives you've considered

We can add that option to the php-nextgen generator only.

Additional context

Can do myself and submit PR. I would add that config option at root level to AbstractPhpGenerator. Template for the interface should be pretty easy, because it obviously contains methods declarations only.

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