Skip to content

Update best_practices.rst #14850

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

Merged
merged 1 commit into from
May 28, 2021
Merged

Update best_practices.rst #14850

merged 1 commit into from
May 28, 2021

Conversation

botris
Copy link
Contributor

@botris botris commented Jan 18, 2021

It seems that all bundles extend Symfony\Component\HttpKernel\Bundle\Bundle which should be included in the requirements.
Also as Symfony\Component\HttpKernel\Bundle\Bundle already has final public function getName() it makes sense to remove the suggestion that this method should be implemented.

weaverryan added a commit to symfony-tools/carsonbot that referenced this pull request Jan 19, 2021
This PR was merged into the master branch.

Discussion
----------

Disable suggesting reviewers in docs repository

I shortly discussed this with the doc team, and I think this feature is not applicable to the docs repo:

* It's very common for us to not respond to a PR within 20 hours
* Many documents are created by us, the community mostly fixes small stuff. Also, 1 document contains many features, editing a line somewhere in the document doesn't indicate you're the expert for other features in the document. E.g. in symfony/symfony-docs#14850, the pinged user modified the example README: symfony/symfony-docs@6e8d393

Commits
-------

7c9391d Disable suggesting reviewers in docs repository
@symfony symfony deleted a comment from carsonbot Jan 21, 2021
@javiereguiluz
Copy link
Member

Thanks for this contribution. I wasn't sure about this, so I checked the code and I found this:

https://github.com/symfony/symfony/blob/5.x/src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php#L89-L97

Apparently, we don't check if the class is an instance of Bundle::class. I might be wrong, so please point me to the code where this class is enforced. Thanks!

@botris
Copy link
Contributor Author

botris commented Jan 22, 2021

I don't think it's enforced, but I do think it's a best practice. I've been looking at various widely used packages to get familiar with bundles and they all seem to extend Bundle::class.
As it offers some helper methods and eliminates the need to write your own getName implementation etc.
But maybe state that it's a best practice but not enforced?

@javiereguiluz
Copy link
Member

I've asked around but nobody gives me a clear answer ... so let's merge this. Thanks Boris!

@javiereguiluz javiereguiluz changed the base branch from 5.2 to 4.4 May 28, 2021 07:34
@javiereguiluz javiereguiluz changed the base branch from 4.4 to 5.2 May 28, 2021 07:34
@javiereguiluz javiereguiluz changed the base branch from 5.2 to 4.4 May 28, 2021 07:36
@javiereguiluz javiereguiluz changed the base branch from 4.4 to 5.2 May 28, 2021 07:36
@javiereguiluz javiereguiluz merged commit e460402 into symfony:5.2 May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants