Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add return/scalar type declarations to the generated code #5

Open
SDParish opened this issue Nov 6, 2020 · 0 comments
Open

Add return/scalar type declarations to the generated code #5

SDParish opened this issue Nov 6, 2020 · 0 comments

Comments

@SDParish
Copy link

SDParish commented Nov 6, 2020

The composer.json requires "php": ">=7.1". I am assuming this means that the generated php code is also targeting that version.

Since php 7, return type declarations are supported, along with scalar type declarations.
Since php 7.1, the void return type is supported as well.

I am proposing that the generated php classes are updated to provide these type declarations.

For example in a generated Request, the setBody function would gain the void return type, and sendWith would return SwaggerModel (assuming a response is not a simple scalar type), whilst in a generated Model, a string property's getter would have a string return type, and its setter have its argument declared as a string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant