-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
[RFC][make:entity] Add an option to generate fluent or not fluent setters #297
Comments
@borNfreee thanks for your proposal. At first sight I'd say we shouldn't make this configurable ... because the current behaviour is configurable (more precisely, it's flexible). If you generate fluent setters, you can decide if you prefer to use them fluently or not. Both ways work. But if you don't make them fluent or make it configurable ... user must check which is the format to use, etc. |
Could you please explain what do you mean here? Some background of why I think there should be an option:
|
If this should be implemented, then we maybe should support it to be configurable with the bundle's configuration. |
Yea, I'd be fine with this - as configuration in the bundle itself (not as an interactive question)... which I think would work better for your use-case anyways (one consistent way of generating entities through a project, every time). Someone just needs to add the config and make the generate respect it - it's a "fairly" easy change :). Cheers! |
If someone tries to implement this: remember that some generated code rely on these fluid interfaces. |
Hi everyone!
The only one mention about fluent setters I found is here: #104, but nothing has been implemented as far as I see from the source code.
There is a flag that checks whether to generate fluent setters or not, here
maker-bundle/src/Util/ClassSourceManipulator.php
Lines 947 to 951 in 705d3a2
but it's impossible to override the default value (which is
true
- setters are fluent), because manipulator class is instantiated always withtrue
:maker-bundle/src/Maker/MakeEntity.php
Line 769 in 705d3a2
Note the last parameter
maker-bundle/src/Util/ClassSourceManipulator.php
Line 57 in 705d3a2
Proposal
What do you think about adding an option that will allow overriding this flag? For example:
or something like that.
If this would be useful from your point of view, I would be able to send a PR.
The text was updated successfully, but these errors were encountered: