-
-
Notifications
You must be signed in to change notification settings - Fork 441
Description
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
| private function makeMethodFluent(Builder\Method $methodBuilder) | |
| { | |
| if (!$this->fluentMutators) { | |
| return; | |
| } |
but it's impossible to override the default value (which is true - setters are fluent), because manipulator class is instantiated always with true:
maker-bundle/src/Maker/MakeEntity.php
Line 769 in 705d3a2
| $manipulator = new ClassSourceManipulator($this->fileManager->getFileContents($path), $overwrite); |
Note the last parameter
| public function __construct(string $sourceCode, bool $overwrite = false, bool $useAnnotations = true, bool $fluentMutators = true) |
Proposal
What do you think about adding an option that will allow overriding this flag? For example:
bin/console make:entity --fluent-setters=false
or something like that.
If this would be useful from your point of view, I would be able to send a PR.