8000 Standardize the name of the container configurator variable · Issue #17381 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Standardize the name of the container configurator variable #17381

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

Closed
javiereguiluz opened this issue Oct 20, 2022 · 9 comments
Closed

Standardize the name of the container configurator variable #17381

javiereguiluz opened this issue Oct 20, 2022 · 9 comments
Labels
DependencyInjection Waiting team decision Request for comments from Symfony Docs Team members

Comments

@javiereguiluz
Copy link
Member

I think this issue was mentioned by @ThomasLandauer in the past, and I was sure that we already had fixed it ... but I was wrong 😞

We use different variable names for similar code examples:

(1) return function(ContainerConfigurator $container) {

(2) return function(ContainerConfigurator $configurator) {

(3) return function(ContainerConfigurator $containerConfigurator) {

(3) is very rarely used, but (1) and (2) are used about the same ~50%.

So, which is your preferred variable name so we can always use the same for all code examples? Thanks!

@wouterj
Copy link
Member
wouterj commented Oct 20, 2022

Imho, this is just a matter of "pick one and stick to it".

Since I don't really have any favor, I would chose the one used in the Service Container guide at the moment: $configurator

@ThomasLandauer
Copy link
Contributor
ThomasLandauer commented Oct 20, 2022

My personal experience: Whenever I use some sort of abbreviation in a variable name myself, I'm eventually going to expand it in the next round...

And since there's probably a reason why the very class wasn't named Container or Configurator, I clearly vote for 3: $containerConfigurator.

Just for reference: This is the PR you had in mind: #17134

@alamirault
Copy link
Contributor

I vote for 3: $containerConfigurator.

This avoid question naming, it's always class name.

@OskarStark
Copy link
Contributor

I like it too @alamirault 👍🏻

I can create a doctor rule to ensure this

@alamirault
Copy link
Contributor

I can update rst files. Which branch must be targeted ? 6.3 ?

@OskarStark
Copy link
Contributor

The lowest one, 5.4, then we merge up and you can checke 6.0 and so on...

Thanks for your work ✊🏻

@OskarStark
Copy link
Contributor

@javiereguiluz @weaverryan @xabbuh @wouterj please vote, thanks

@xabbuh
Copy link
Member
xabbuh commented Jan 4, 2023

I do not have any strong feeling about this, but $configurator or $containerConfigurator sound better to me than $container.

@alamirault
Copy link
Contributor

I created PR #17664 to move forward, let's see if you like it or not 😄

xabbuh added a commit that referenced this issue Jan 6, 2023
…ble (alamirault)

This PR was merged into the 5.4 branch.

Discussion
----------

Standardize the name of the container configurator variable

#17381

Use always `ContainerConfigurator $containerConfigurator` instead of `$container` or `$configurator`

Commits
-------

a9cbf8b Standardize the name of the container configurator variable
@xabbuh xabbuh closed this as completed Jan 6, 2023
javiereguiluz added a commit that referenced this issue Jan 7, 2023
…ble 6.0 (alamirault)

This PR was merged into the 6.0 branch.

Discussion
----------

Standardize the name of the container configurator variable 6.0

Continue #17381 on 6.0

Commits
-------

981889e Standardize the name of the container configurator variable 6.0
javiereguiluz added a commit that referenced this issue Jan 7, 2023
…ble 6.1 (alamirault)

This PR was merged into the 6.1 branch.

Discussion
----------

Standardize the name of the container configurator variable 6.1

Continue #17381 on 6.1

Commits
-------

6943bc7 Standardize the name of the container configurator variable 6.1
javiereguiluz added a commit that referenced this issue Jan 7, 2023
…ble 6.2 (alamirault)

This PR was merged into the 6.2 branch.

Discussion
----------

Standardize the name of the container configurator variable 6.2

Continue #17381 on 6.2

Commits
-------

ff9ce3d Standardize the name of the container configurator variable 6.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DependencyInjection Waiting team decision Request for comments from Symfony Docs Team members
Projects
None yet
Development

No branches or pull requests

6 participants
0