Chapters
23 Chapters
|
2:20:28
|
Login to bookmark this video
-
Course Code
Subscribe to download the code!
Subscribe to download the code!
-
This Video
Subscribe to download the video!
Subscribe to download the video!
-
Subtitles
Subscribe to download the subtitles!
Subscribe to download the subtitles!
-
Course Script
Subscribe to download the script!
Subscribe to download the script!
21.
MakerBundle & Autoconfigure
Scroll down to the script below, click on any sentence (including terminal blocks) to jump to that spot in the video!
Subscribe to jump to this part in the video!
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.
This tutorial also works great for Symfony 6!
What PHP libraries does this tutorial use?
// composer.json
{
"require": {
"php": "^7.3.0 || ^8.0.0",
"ext-ctype": "*",
"ext-iconv": "*",
"composer/package-versions-deprecated": "^1.11", // 1.11.99
"knplabs/knp-markdown-bundle": "^1.8", // 1.9.0
"sensio/framework-extra-bundle": "^6.0", // v6.2.1
"sentry/sentry-symfony": "^4.0", // 4.0.3
"symfony/asset": "5.0.*", // v5.0.11
"symfony/console": "5.0.*", // v5.0.11
"symfony/debug-bundle": "5.0.*", // v5.0.11
"symfony/dotenv": "5.0.*", // v5.0.11
"symfony/flex": "^1.3.1", // v1.21.6
"symfony/framework-bundle": "5.0.*", // v5.0.11
"symfony/monolog-bundle": "^3.0", // v3.6.0
"symfony/profiler-pack": "*", // v1.0.5
"symfony/routing": "5.1.*", // v5.1.11
"symfony/twig-pack": "^1.0", // v1.0.1
"symfony/var-dumper": "5.0.*", // v5.0.11
"symfony/webpack-encore-bundle": "^1.7", // v1.8.0
"symfony/yaml": "5.0.*" // v5.0.11
},
"require-dev": {
"symfony/maker-bundle": "^1.15", // v1.23.0
"symfony/profiler-pack": "^1.0" // v1.0.5
}
}
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!