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

[DI] Fixes aliases visibility with and without defaults#21219

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
fabpot merged 1 commit intosymfony:masterfromogizanagi:fix/3.3/di/aliases_defaults
Jan 9, 2017
Merged

[DI] Fixes aliases visibility with and without defaults#21219

fabpot merged 1 commit intosymfony:masterfromogizanagi:fix/3.3/di/aliases_defaults
Jan 9, 2017

Conversation

@ogizanagi
Copy link
Contributor

QA
Branch?master
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#21071 (comment)
LicenseMIT
Doc PRN/A

takeit reacted with thumbs up emoji
$this->assertTrue(isset($aliases['alias_for_foo']),'->load() parses aliases');
$this->assertEquals('foo', (string)$aliases['alias_for_foo'],'->load() parses aliases');
$this->assertTrue($aliases['alias_for_foo']->isPublic());
$this->assertTrue($aliases['another_third_alias_for_foo']->isPublic());

Choose a reason for hiding this comment

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

Duplicate below?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Oops. Thanks.

}
}else {
$defaults =array();
$defaults =array('public' =>true);

Choose a reason for hiding this comment

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

Case above that triggers a deprecation?

ogizanagi reacted with thumbs up emoji
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Fixed.

Copy link
ContributorAuthor

@ogizanagiogizanagiJan 9, 2017
edited
Loading

Choose a reason for hiding this comment

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

Actually, would you prefer using the same way as you did for classic definitions, i.e:

$public =isset($service['public']) ?$service['public'] : (isset($defaults['public']) ?$defaults['public'] :true);

rather than adding this in defaults?

To me it makes sense to define canonical defaults, but then I should probably updatehttps://github.com/symfony/symfony/blob/master/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php#L274 too

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Previous fix was not enough in case_defaults: { public: true } was set anyway... So updated.

-name:baz

with_defaults_aliased:
alias:'with_defaults'
Copy link
Contributor

Choose a reason for hiding this comment

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

I would remove single quotes here, in order to harmonize it with thedocumentation. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

ah it actually doesn't matter :)

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

That's only fixtures, so we don't care much IMHO. But ok. :)

calls:
-[ setBar, [ foo, '@foo', [true, false] ] ]
alias_for_foo:'@foo'
another_third_alias_for_foo:
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

This alias is beforeanother_alias_for_foo because of an issue with theYamlDumper. See#21220

fabpot added a commit that referenced this pull requestJan 9, 2017
This PR was merged into the 2.7 branch.Discussion----------[DI] Fix missing new line after private alias| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#21219 (comment)| License       | MIT| Doc PR        | N/AWithout this change, the output is:```yml# [...]alias_for_foo: '@foo'another_alias_for_foo:    alias: foo    public: false    another_third_alias_for_foo: '@foo' # <--- missing new line after `public: false````(this is tested by the `CrossCheckTest` but there is no fixture file to update (automatically dumped and removed by the test case))Commits-------101a165 [DI] Fix missing new line after private alias
@fabpot
Copy link
Member

Thank you@ogizanagi.

@fabpotfabpot merged commitf1cc090 intosymfony:masterJan 9, 2017
fabpot added a commit that referenced this pull requestJan 9, 2017
…gizanagi)This PR was merged into the 3.3-dev branch.Discussion----------[DI] Fixes aliases visibility with and without defaults| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#21071 (comment)| License       | MIT| Doc PR        | N/ACommits-------f1cc090 [DI] Fixes aliases visibility with and without defaults
@ogizanagiogizanagi deleted the fix/3.3/di/aliases_defaults branchJanuary 9, 2017 20:27
takeit added a commit to takeit/web-publisher that referenced this pull requestJan 9, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

+1 more reviewer

@takeittakeittakeit 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

@ogizanagi@fabpot@nicolas-grekas@takeit@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp