Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fixed code examples and format in the DI component documentation#2013

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
weaverryan merged 3 commits intosymfony:2.0fromwouterj:patch-22
Dec 26, 2012

Conversation

wouterj
Copy link
Member

No description provided.

->addArgument('%mailer.transport%');
$container
->register('mailer', 'Mailer')
->addArgument('%mailer.transport%');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I like breaking it onto 2 lines, but I don't usually add extra spaces on the second line of a chained call. Any reason why you're doing this - is it in the core code somewhere?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

If the method returns itself each time and you have method chaining, I won't indent the second line, but if the method returns a new instance it is nice to indent the next line. We have done that in thecomponent/config article too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

the only place where we use extra indentation levels when chaining in Symfony is when using theSymfony\Component\Config\Definition\TreeBuilder, to make the indentation reflect the tree structure (making it far more readable than 100 chained calls indented the same)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@wouterj, I see your point, and I don't think we have a super-clear standard here one way or another, but I'm personally -1 on the format. It makes more sense in theTreeBuilder because you actually have->end() statements at each node - so you build up the tree (and indent), and then have to work your way back down the tree (with->end()). In this case, we're not returning the same instance, but it's not that same tree structure.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@weaverryan ok, I will change it today.

weaverryan added a commit that referenced this pull requestDec 26, 2012
Fixed code examples and format in the DI component documentation
@weaverryanweaverryan merged commitf2dbd6b intosymfony:2.0Dec 26, 2012
@weaverryan
Copy link
Member

Awesome, thanks!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@wouterj@weaverryan@stof

[8]ページ先頭

©2009-2025 Movatter.jp