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] Fix error when trying to resolve a DefinitionDecorator#20543

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:2.7fromnicolas-grekas:warn-def-deco
Nov 17, 2016

Conversation

@nicolas-grekas
Copy link
Member

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

Instead of the currently obscureReflectionException: Class does not exist message, let's throw a useful error message.

HeahDude and chalasr reacted with heart emoji
*/
publicfunctioncreateService(Definition$definition,$id,$tryProxy =true)
{
if ($definitioninstanceof DefinitionDecorator) {
Copy link
Member

Choose a reason for hiding this comment

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

What about checking this in a more generic way (i.e. forbidding allDefinition subclasses)?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

that way?

Copy link
Member

Choose a reason for hiding this comment

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

👍

@stof
Copy link
Member

👍

1 similar comment
@xabbuh
Copy link
Member

👍

publicfunctioncreateService(Definition$definition,$id,$tryProxy =true)
{
if ('Symfony\Component\DependencyInjection\Definition' !==get_class($definition)) {
thrownewRuntimeException(sprintf('Constructing service "%s" from a %s is not supported at build time.',$id,get_class($definition)));
Copy link
Member

Choose a reason for hiding this comment

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

missing"" around the second %s

@fabpot
Copy link
Member

Thank you@nicolas-grekas.

@fabpotfabpot merged commit8e0da2f intosymfony:2.7Nov 17, 2016
fabpot added a commit that referenced this pull requestNov 17, 2016
…r (nicolas-grekas)This PR was merged into the 2.7 branch.Discussion----------[DI] Fix error when trying to resolve a DefinitionDecorator| Q             | A| ------------- | ---| Branch?       | 2.7| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -Instead of the currently obscure `ReflectionException: Class does not exist` message, let's throw a useful error message.Commits-------8e0da2f [DI] Fix error when trying to resolve a DefinitionDecorator
@nicolas-grekasnicolas-grekas deleted the warn-def-deco branchNovember 17, 2016 16:26
This was referencedNov 21, 2016
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot left review comments

@xabbuhxabbuhxabbuh left review comments

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@nicolas-grekas@stof@xabbuh@fabpot@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp