Open xvilo opened 4 years ago
I would add typehinting to all current PHP generators without a feature flag. The biggest advantage to me as library creator is that I don't need to check income parameters anymore, PHP does it for me and throws TypeError
exception.
Btw @xvilo, we have open PR #6620 with Symfony generator upgrade, you can test it, any feedback is welcome.
Thanks @ybelenko, I can check sometime. Btw, I've already contributed the following change: #5348
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:
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:
What it could become afterward: