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

[Config] Add ExprBuilder::ifEmpty()#6922

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

Conversation

@ogizanagi
Copy link
Contributor

@wouterj
Copy link
Member

Can you please add(since Symfony 3.2) after the list item?

@ogizanagiogizanagiforce-pushed thefeature/3.2/config/if_empty_expr_builder branch from7ef398d tof0fe739CompareAugust 28, 2016 16:54
@ogizanagi
Copy link
ContributorAuthor

@wouterj : Added :)

fabpot added a commit to symfony/symfony that referenced this pull requestAug 31, 2016
This PR was merged into the 3.2-dev branch.Discussion----------[Config] Add ExprBuilder::ifEmpty()| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |symfony/symfony-docs#6922Useful for instance when you don't expect to have a key set in the resolved config if its content is empty:```php$builder = new TreeBuilder();$tree = $builder    ->root('matcher')        ->children()            ->arrayNode('references_to_exclude')                ->validate()                    ->ifEmpty()                    ->thenUnset()                ->end()                ->prototype('scalar')->end()            ->end()        ->end()    ->end()    ->buildTree();$tree->finalize(['references_to_exclude' => ['foo', 'bar']]);>>> ['references_to_exclude' => ['foo', 'bar']]$tree->finalize(['references_to_exclude' => []]);>>> []```Commits-------4e46f64 [Config] Add ExprBuilder::ifEmpty()
symfony-splitter pushed a commit to symfony/config that referenced this pull requestAug 31, 2016
This PR was merged into the 3.2-dev branch.Discussion----------[Config] Add ExprBuilder::ifEmpty()| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |symfony/symfony-docs#6922Useful for instance when you don't expect to have a key set in the resolved config if its content is empty:```php$builder = new TreeBuilder();$tree = $builder    ->root('matcher')        ->children()            ->arrayNode('references_to_exclude')                ->validate()                    ->ifEmpty()                    ->thenUnset()                ->end()                ->prototype('scalar')->end()            ->end()        ->end()    ->end()    ->buildTree();$tree->finalize(['references_to_exclude' => ['foo', 'bar']]);>>> ['references_to_exclude' => ['foo', 'bar']]$tree->finalize(['references_to_exclude' => []]);>>> []```Commits-------4e46f64 [Config] Add ExprBuilder::ifEmpty()
@ogizanagiogizanagi changed the title[WCM][Config] Add ExprBuilder::ifEmpty()[Config] Add ExprBuilder::ifEmpty()Aug 31, 2016
@ogizanagi
Copy link
ContributorAuthor

Code repository PR is now merged :)

@wouterjwouterj removed the On hold labelAug 31, 2016
@wouterj
Copy link
Member

Cool! Let's merge this one as well then.

👍
status: review

@weaverryan
Copy link
Member

Awesome, thanks Maxime!

@weaverryanweaverryan merged commitf0fe739 intosymfony:masterSep 18, 2016
weaverryan added a commit that referenced this pull requestSep 18, 2016
This PR was merged into the master branch.Discussion----------[Config] Add ExprBuilder::ifEmpty()Aftersymfony/symfony#19764Commits-------f0fe739 [WCM][Config] Add ExprBuilder::ifEmpty()
@ogizanagiogizanagi deleted the feature/3.2/config/if_empty_expr_builder branchSeptember 19, 2016 06:32
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@ogizanagi@wouterj@weaverryan@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp