-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Allow generators instead of deriving from strings in various Generator classes #74
Comments
Why would a |
Hi @Ocramius - for me it makes sense to pass it in as you're storing an instance of a I also think the benefits far outweigh the minor work needed to do this. I can happily write the additional unit test required if that would help? |
That's a
Overall, I'm OK with passing in a Reason for this is that we can then deprecate |
Great I'll provide some code for review ASAP with the above in mind |
Hello,
Personally, I have my preference for the interface of @simon-mundy
@see https://github.com/laminas/laminas-code/blob/4.12.x/src/Generator/PropertyGenerator.php#L344 But whatever, thank you |
Referencing #30 and the issue with type-hinted parameters.
Currently the method for setting Type Hints in the
ParameterGenerator
enforces an object by deriving theTypeGenerator
from a string.It would be trivial and would not break existing code to change the method to allow a
$type
of either a string or aGeneratorInterface
to be passed in, and therefore allow custom treatment of type hints (allowing aliases)Would really appreciate this minor change being implemented - it creates as much work to re-code generated code to be less verbose when it could be easily avoided.
The text was updated successfully, but these errors were encountered: