-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
[Bundles] Promote the new bundle structure everywhere #19793
Conversation
Yes, it's perfect timing since we introduced I'll check the documentation later; thanks for the ping! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! I'm going through this PR at the same time I'm updating verify-email-bundle
&& reset-password-bundle
codebase.
Minor detail on argument names to match the parent method...
I'll give some more feedback as I work through the PR's
Thanks for the reviews. I updated the things you asked me to. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more minor thing - aside from that - this looks good!
bundles/extension.rst
Outdated
|
||
class AcmeHelloBundle extends AbstractBundle | ||
{ | ||
public function loadExtension(array $config, ContainerConfigurator $containerConfigurator, ContainerBuilder $containerBuilder): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just caught this one too (match AbstractBundle::loadExtension()
arg names)
public function loadExtension(array $config, ContainerConfigurator $container, ContainerBuilder $builder): void
Linter appears to be complaining about this. Pretty sure this is a false positive in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We added a rule to explicitly name them like this, not sure its a good idea anymore 🤔
@alamirault were you involved back then with this rule?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't looked at the code for the rule - but I'm guessing it could be improved by adding a conditional to check if the variable name matches the first|second|third... "word part" of the type name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've already reverted most of the changes to the longer name: #18299
Let's remove the rule imho
Please rebase to fix DOCtor-RST build, thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A whole lot of awesomeness going on here 😄
After talking with @jrushlow, it's clear that there are some docs that still promote too much the legacy bundle structure, which is inconsistent with the best-practices explained in https://symfony.com/doc/current/bundles.html and https://symfony.com/doc/current/bundles/best_practices.html
So, I propose to update those articles (https://symfony.com/doc/current/bundles/extension.html#loading-services-directly-in-your-bundle-class and https://symfony.com/doc/current/bundles/configuration.html#using-the-abstractbundle-class) to always explain first the simpler solution based on
AbstractBundle
.Pinging @yceruto because he's the most active folk on everything related to simplifying bundles. Thanks!