21.
MakerBundle & Autoconfigure
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
Whoops, an error! Please, try again later.
6 Comments
Guys, when I use make commands and console binary generates code it
positions curly braces inconsistently. For example class and method
bodies has opening brace on new line, but condition structures have
opening brace on the same line.
I don't like it, because I want to be consistent.
I know that this is the recommended style by PSR2, but can I configure it somehow? Or I can rely only on my editor?
Hey Ruslan I.!
Oh no! Do you have a specific Maker command where you see this? In the MakerBundle test suite, we actually run php-cs-fixer on the code, and if it results in any changes (meaning the generated code did NOT have perfect coding standards), it should fail the test suite. So this is something we actively try to do correctly. If it's wrong somewhere, that's a bug! So let me know :).
Cheers!
I think you misunderstood me. I want to change default Maker's styling.
For example, I want to remove curly braces, when there is only 1 statement in IF block.
So I don't want to stick to the standards.
Hey Ruslan I.!
Ah! I understand better now :). This is not possible in MakerBundle. It's on purpose (it was my decision): trying to make this level of detail configurable would be *super* complex. However, I'd recommend installing php-cs-fixer. If you can find/configure a rule for your coding style, then you could (A) run Maker then (B) run php-cs-fixer to change the code to your style.
Cheers!
"Houston: no signs of life"
Start the conversation!