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] Throw useful exception on bad XML argument tags#22527

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:masterfromnicolas-grekas:di-strict-xml
Apr 29, 2017

Conversation

@nicolas-grekas
Copy link
Member

QA
Branch?3.3
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#22525
LicenseMIT
Doc PR-

I still think that the feature request in#22525 would make things better.
But at least, let's make thing fail loudly, instead of silently today, with the associated usual wtfs :)

linaori, ogizanagi, sstok, and ro0NL reacted with thumbs up emoji
@nicolas-grekas
Copy link
MemberAuthor

Needs#22529 to be green.


switch ($arg->getAttribute('type')) {
case'service':
if (!$arg->getAttribute('id')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

hasAttribute?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

An empty attribute is also invalid, so better as is IMHO

sstok reacted with thumbs up emoji
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok 👍

break;
case'closure-proxy':
if (!$arg->getAttribute('id')) {
thrownewInvalidArgumentException(sprintf('Tag "<%s>" with type="service" is missing an "id" attribute in "%s".',$name,$file));
Copy link
Member

Choose a reason for hiding this comment

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

wrong type

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

fixed thanks

thrownewInvalidArgumentException(sprintf('Tag "<%s>" with type="service" is missing an "id" attribute in "%s".',$name,$file));
}
if (!$arg->getAttribute('method')) {
thrownewInvalidArgumentException(sprintf('Tag "<%s>" with type="service" is missing a "method" attribute in "%s".',$name,$file));
Copy link
Member

Choose a reason for hiding this comment

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

wrong type

@nicolas-grekasnicolas-grekasforce-pushed thedi-strict-xml branch 2 times, most recently fromae21520 tocdc24baCompareApril 26, 2017 14:24
@nicolas-grekas
Copy link
MemberAuthor

rebased


switch ($arg->getAttribute('type')) {
case'service':
if (!$arg->getAttribute('id')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok 👍

switch ($arg->getAttribute('type')) {
case'service':
if (!$arg->getAttribute('id')) {
thrownewInvalidArgumentException(sprintf('Tag "<%s>" with type="service" is missing an "id" attribute in "%s".',$name,$file));
Copy link
Member

Choose a reason for hiding this comment

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

is missing or is empty?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

fixed

@fabpot
Copy link
Member

Thank you@nicolas-grekas.

@fabpotfabpot merged commit91828ec intosymfony:masterApr 29, 2017
fabpot added a commit that referenced this pull requestApr 29, 2017
…nicolas-grekas)This PR was merged into the 3.3-dev branch.Discussion----------[DI] Throw useful exception on bad XML argument tags| Q             | A| ------------- | ---| Branch?       | 3.3| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#22525| License       | MIT| Doc PR        | -I still think that the feature request in#22525 would make things better.But at least, let's make thing fail loudly, instead of silently today, with the associated usual wtfs :)Commits-------91828ec [DI] Throw useful exception on bad XML argument tags
@nicolas-grekasnicolas-grekas deleted the di-strict-xml branchApril 29, 2017 16:39
@fabpotfabpot mentioned this pull requestMay 1, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot left review comments

@stofstofstof requested changes

+1 more reviewer

@GuilhemNGuilhemNGuilhemN approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.3

Development

Successfully merging this pull request may close these issues.

5 participants

@nicolas-grekas@fabpot@stof@GuilhemN@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp