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

[OptionsResolver] Add new OptionConfigurator class to define options with fluent interface#33848

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

Conversation

lmillucci
Copy link
Contributor

@lmilluccilmillucci commentedOct 4, 2019
edited by yceruto
Loading

QA
Branch?master
Bug fix?no
New feature?yes
Deprecations?no
TicketsFix#33735
LicenseMIT
Doc PRsymfony/symfony-docs#12426
  • submit changes to the documentation

This PR adds OptionConfigurator to the OptionsResolver

yceruto, fancyweb, deguif, adamwojs, ro0NL, cristoforocervino, Taluu, and GromNaN reacted with thumbs up emojistloyd and Taluu reacted with confused emojisstok and cristoforocervino reacted with heart emoji
Copy link
Member

@ycerutoyceruto left a comment

Choose a reason for hiding this comment

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

Thanks@lmillucci for working on this feature :) I like it ! and congratulation for your first pull request.

I've left some comments to move as fast as we can, thanks again.

lmillucci reacted with thumbs up emoji
@ro0NL
Copy link
Contributor

something else we may want to consider, and what we did for DI configurators as well, is to make it truly fluid;

$optionsResolver    ->define('foo')        ->required()    ->define('bar')        ->required();
fancyweb, yceruto, deguif, and sstok reacted with thumbs up emoji

Copy link
Member

@ycerutoyceruto left a comment

Choose a reason for hiding this comment

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

With minor comments.

@yceruto
Copy link
Member

yceruto commentedOct 7, 2019
edited
Loading

@lmillucci thanks for your work and for solving all comments.

After the discussion we had about this#33848 (comment) where I suggest you to remove the annotation@return $this, I think we should add it again now, because it should help make it clear that it is a fluent interface by saying that each method will return the same instance of the class$this, except for thedefine() method that will return a new instance.

I'm sorry about that, and I hope you're okay.

@lmillucci
Copy link
ContributorAuthor

@yceruto no problem, I've easily restored@return $this annotation for all methods exceptdefine()

yceruto reacted with thumbs up emoji

@ycerutoyceruto changed the title[OptionsResolver] add OptionConfigurator Issue #33735[OptionsResolver] Add new OptionConfigurator class to define options with fluent interfaceOct 9, 2019
@yceruto
Copy link
Member

@stof could you please review this PR again and have your vote on this ? thanks!

@yceruto
Copy link
Member

ping @symfony/mergers ?

@yceruto
Copy link
Member

Ready for final reviews (the fabbot.io failure is a false positive)

@yceruto
Copy link
Member

@lmillucci do you like to finish this proposal?

@lmillucci
Copy link
ContributorAuthor

lmillucci commentedJan 20, 2020
edited
Loading

@lmillucci do you like to finish this proposal?

@yceruto Yes, what exception should be thrown when defining an already defined option? Something likeOptionDefinitionException should be ok?

@yceruto
Copy link
Member

@lmillucci yes,OptionDefinitionException would be ok.

@yceruto
Copy link
Member

@lmillucci almost done :) you just need to rebase onmaster branch to make it ready for Symfony 5.1

@yceruto
Copy link
Member

there is a commit that don't belongs to this PRf825642 (the first one) could you please, fix it? thanks!

lmillucci reacted with thumbs up emoji

@chalasr
Copy link
Member

The component's CHANGELOG file should mention this change.

@nicolas-grekas
Copy link
Member

Thank you@lmillucci.

nicolas-grekas added a commit that referenced this pull requestFeb 6, 2020
…define options with fluent interface (lmillucci, yceruto)This PR was merged into the 5.1-dev branch.Discussion----------[OptionsResolver] Add new OptionConfigurator class to define options with fluent interface| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| Deprecations? | no| Tickets       |Fix#33735| License       | MIT| Doc PR        |symfony/symfony-docs#12426- [x] submit changes to the documentationThis PR adds OptionConfigurator to the OptionsResolverCommits-------1ff5640 [OptionsResolver] Add new OptionConfigurator class to define options with fluent interface
@nicolas-grekasnicolas-grekas merged commit1ff5640 intosymfony:masterFeb 6, 2020
OskarStark added a commit to symfony/symfony-docs that referenced this pull requestFeb 19, 2020
…lucci)This PR was squashed before being merged into the master branch.Discussion----------[OptionResolver] Document the OptionConfiguratorAdd `define()` method to OptionResolver to enhance readability of option configuration. Seesymfony/symfony#33848Commits-------921c73f [OptionResolver] Document the OptionConfigurator
@nicolas-grekasnicolas-grekas modified the milestones:next,5.1May 4, 2020
@fabpotfabpot mentioned this pull requestMay 5, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@stofstofstof requested changes

@TobionTobionTobion requested changes

@ro0NLro0NLro0NL left review comments

@ogizanagiogizanagiogizanagi approved these changes

@fancywebfancywebfancyweb left review comments

@ycerutoycerutoyceruto approved these changes

@dunglasdunglasAwaiting requested review from dunglas

@lyrixxlyrixxAwaiting requested review from lyrixx

@srozesrozeAwaiting requested review from sroze

@xabbuhxabbuhAwaiting requested review from xabbuh

Assignees
No one assigned
Projects
None yet
Milestone
5.1
Development

Successfully merging this pull request may close these issues.

Add OptionsResolver::configureOptions()
10 participants
@lmillucci@ro0NL@yceruto@chalasr@nicolas-grekas@stof@Tobion@ogizanagi@fancyweb@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp