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

Use the new configurator YAML syntax#7203

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

Closed
javiereguiluz wants to merge4 commits intosymfony:3.2fromjaviereguiluz:fix_7176

Conversation

@javiereguiluz
Copy link
Member

Thisfixes#7176.

class:AppBundle\Mail\NewsletterManager
arguments:['@mailer']
configurator:['@app.email_configurator',configure]
configurator:'app.email_configurator:configure'
Copy link
Member

Choose a reason for hiding this comment

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

you actually have to use two colons

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Like this?

configurator: 'app.email_configurator::configure'

Copy link
Member

Choose a reason for hiding this comment

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

yes

Copy link
Member

Choose a reason for hiding this comment

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

@xabbuh that's not true. 2 colons are used when doing a callable referencing a static method (the PHP standard notationClass::staticMethod). The shortcut syntax for service method callables uses a single colon (i.e. something which cannot appear in a valid PHP callable), as done already for the routing configuration.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry for the confusion Javier.@stof is indeed right.

@xabbuh
Copy link
Member

I think we should then document this notation for factories too.

class:AppBundle\Mail\NewsletterManager
arguments:['@mailer']
configurator:['@app.email_configurator',configure]
configurator:'app.email_configurator:configure'
Copy link
Member

Choose a reason for hiding this comment

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

@xabbuh that's not true. 2 colons are used when doing a callable referencing a static method (the PHP standard notationClass::staticMethod). The shortcut syntax for service method callables uses a single colon (i.e. something which cannot appear in a valid PHP callable), as done already for the routing configuration.

->setConfigurator(array(new Reference('app.email_configurator'), 'configure'))
;
..note::
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't it beversionadded ?

@javiereguiluz
Copy link
MemberAuthor

@xabbuh let's do the factories change in another PR:#7208

# old syntax
configurator:['@app.email_configurator', configure]
..versionadded::3.2
Copy link
Member

Choose a reason for hiding this comment

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

Theversionadded directive nested in thenote block doesn't look very nice. What about instead transforming thenote into aversionadded instead as@stof suggested.

HeahDude reacted with thumbs up emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Done!

@xabbuh
Copy link
Member

Thank you Javier.

xabbuh added a commit that referenced this pull requestApr 15, 2017
This PR was squashed before being merged into the 3.2 branch (closes#7203).Discussion----------Use the new configurator YAML syntaxThisfixes#7176.Commits-------88e30b0 Use the new configurator YAML syntax
xabbuh added a commit that referenced this pull requestApr 15, 2017
@xabbuhxabbuh closed thisApr 15, 2017
weaverryan added a commit that referenced this pull requestApr 15, 2017
* 3.2: (71 commits)  Rewriting the service container docs  Minor reword  Adding a tip for validation in forms without class  [#7217] add versionadded directives  [#7203] merge note and versionadded directive  Use the new configurator YAML syntax  Added a note about the .htaccess files included by Symfony apps  Made unmapped field example in forms chapter more descriptive  [#7507] fix namespace  [#7507] fix component name  [#7490] minor typo fix  Added a note about redirections to absolute URLs in tests  [#7204] link to API doc  Added docs for JsonResponse::fromJsonString  Added the changes suggested by reviewers  [#7620] use generate() in PHP templates before 2.8  Fixed the RST syntax  Improve example context  Minor formatting changes  [#7519] some minor tweaks  ...
@javiereguiluzjaviereguiluz deleted the fix_7176 branchMay 24, 2018 16:05
javiereguiluz added a commit that referenced this pull requestMay 29, 2019
…rekas)This PR was merged into the 4.2 branch.Discussion----------Remove short factories/configurators examplesThis PR reverts#7203, as short factories are more confusing than useful.I'm proposing to deprecate them insymfony/symfony#31543Note that some of this patch can (should) be adapted to 3.4 also.Commits-------e8cfa6e Remove short factories/configurators examples
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@xabbuhxabbuhxabbuh left review comments

+1 more reviewer

@stofstofstof left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@javiereguiluz@xabbuh@stof@HeahDude@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp