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] Display previous error messages when throwing unused bindings#27191

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:3.4fromnicolas-grekas:di-bind-error
May 12, 2018

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedMay 7, 2018
edited
Loading

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

As reported by@jvasseur, confirmation + review welcome.

thrownewInvalidArgumentException(sprintf('Unused binding "%s" in service "%s".',$key,$serviceId));
$message =sprintf('Unused binding "%s" in service "%s".',$key,$serviceId);
if ($this->errors) {
$message .=sprintf("\nCould be related to%s:",1 <\count($errors) ?' one of' :'');
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be$this->errors

if ($this->errors) {
$message .=sprintf("\nCould be related to%s:",1 <\count($errors) ?' one of' :'');
}
foreach ($this->errorsas$serviceId =>$mesage) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if the missings is voluntary here, but we can't use$message since it's used in the parent scope, maybe$error ?

$message .=sprintf("\nCould be related to%s:",1 <\count($errors) ?' one of' :'');
}
foreach ($this->errorsas$serviceId =>$mesage) {
$message .=sprintf("\n -\"%s\": %s",$serviceId,$message);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need to put the service id here since it's already in the exception message thrown bygetConstructor.

@nicolas-grekas
Copy link
MemberAuthor

nicolas-grekas commentedMay 8, 2018
edited
Loading

Thank you@jvasseur, comments addressed. Do you confirm it fixes your issue?

Copy link
Contributor

@jvasseurjvasseur left a comment

Choose a reason for hiding this comment

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

This works at solving the issue.

@sroze
Copy link
Contributor

@nicolas-grekas could you add a test for that?

@nicolas-grekas
Copy link
MemberAuthor

Test added.

@fabpot
Copy link
Member

Thank you@nicolas-grekas.

@fabpotfabpot merged commitf2231b5 intosymfony:3.4May 12, 2018
fabpot added a commit that referenced this pull requestMay 12, 2018
…bindings (nicolas-grekas)This PR was merged into the 3.4 branch.Discussion----------[DI] Display previous error messages when throwing unused bindings| Q             | A| ------------- | ---| Branch?       | 3.4| Bug fix?      | yes| New feature?  | n| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#27146| License       | MIT| Doc PR        | -As reported by@jvasseur, confirmation + review welcome.Commits-------f2231b5 [DI] Display previous error messages when throwing unused bindings
@nicolas-grekasnicolas-grekas deleted the di-bind-error branchMay 16, 2018 14:51
This was referencedMay 21, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

+2 more reviewers

@srozesrozesroze approved these changes

@jvasseurjvasseurjvasseur approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

5 participants

@nicolas-grekas@sroze@fabpot@jvasseur@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp