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

[DependencyInjection] Improve an exception message#33092

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:4.3fromfabpot:container-better-error-message
Aug 9, 2019

Conversation

@fabpot
Copy link
Member

QA
Branch?4.3
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketsn/a
LicenseMIT
Doc PRn/a

When defining a service with an id that is also a class name, you might have an error message likeClass “” used for service “\App\Some\Service” cannot be found. if your is starts with a backslash.

The new error message is now hopefully less cryptic:Service definition "\App\Some\Service" has no class, and its name looks like a FQCN but it starts with a backslash; remove the leading backslash.

TomasVotruba reacted with thumbs up emoji
@fabpotfabpot merged commit3647cca intosymfony:4.3Aug 9, 2019
fabpot added a commit that referenced this pull requestAug 9, 2019
This PR was merged into the 4.3 branch.Discussion----------[DependencyInjection] Improve an exception message| Q             | A| ------------- | ---| Branch?       | 4.3| Bug fix?      | yes| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets | n/a| License       | MIT| Doc PR        | n/aWhen defining a service with an id that is also a class name, you might have an error message like `Class “” used for service “\App\Some\Service” cannot be found.` if your is starts with a backslash.The new error message is now hopefully less cryptic: `Service definition "\App\Some\Service" has no class, and its name looks like a FQCN but it starts with a backslash; remove the leading backslash.`Commits-------3647cca [DependencyInjection] improved exception message
@jderussejderusse mentioned this pull requestAug 9, 2019
@ro0NL
Copy link
Contributor

i was curious about doing it inResolveClassPass (vs.CheckDefinitionValidityPass from#28057)

class Kernelextends BaseKernelimplements CompilerPassInterface{publicfunctionprocess(ContainerBuilder$c)    {dd($c->getDefinition('\\Foo\\Bar'));    }

this now breaks :) so perhaps target 4.4? Alternatively cant we fix it in 3.4 at a later stage (i.e. during optimization instead of before)?

Maybe this is too much an edge case, but then 3.4 was fine also 😅 (though 4.3 is fairly new). Just wanted to share this :)

nicolas-grekas added a commit to nicolas-grekas/symfony that referenced this pull requestAug 10, 2019
…message (fabpot)"This reverts commit2f2d1aa, reversingchanges made to07cf927.
nicolas-grekas added a commit to nicolas-grekas/symfony that referenced this pull requestAug 10, 2019
…message (fabpot)"This reverts commit2f2d1aa, reversingchanges made to07cf927.
nicolas-grekas added a commit that referenced this pull requestAug 20, 2019
…ption message" (nicolas-grekas)This PR was merged into the 4.3 branch.Discussion----------Revert "bug#33092 [DependencyInjection] Improve an exception message"| Q             | A| ------------- | ---| Branch?       | 4.3| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -As reminded by@ro0NL in#33092 (comment), it looks like we forgot that `CheckDefinitionValidityPass` already checks and suggests for leading slashes.Why didn't you get the exception from `CheckDefinitionValidityPass`@fabpot?Commits-------ed590ca Revert "bug#33092 [DependencyInjection] Improve an exception message (fabpot)"
symfony-splitter pushed a commit to symfony/dependency-injection that referenced this pull requestAug 20, 2019
…ption message" (nicolas-grekas)This PR was merged into the 4.3 branch.Discussion----------Revert "bug #33092 [DependencyInjection] Improve an exception message"| Q             | A| ------------- | ---| Branch?       | 4.3| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -As reminded by@ro0NL insymfony/symfony#33092 (comment), it looks like we forgot that `CheckDefinitionValidityPass` already checks and suggests for leading slashes.Why didn't you get the exception from `CheckDefinitionValidityPass`@fabpot?Commits-------ed590ca16b Revert "bug #33092 [DependencyInjection] Improve an exception message (fabpot)"
nicolas-grekas added a commit that referenced this pull requestAug 20, 2019
* 4.3:  cs fix  Fix inconsistent return points.  [Config] Add handling for ignored keys in ArrayNode::mergeValues.  Fix inconsistent return points.  [Security/Core] UserInterface::getPassword() can return null  [Router] Fix TraceableUrlMatcher behaviour with trailing slash  Revert "bug#33092 [DependencyInjection] Improve an exception message (fabpot)"
nicolas-grekas added a commit that referenced this pull requestAug 20, 2019
* 4.4:  cs fix  Fix inconsistent return points.  [Config] Add handling for ignored keys in ArrayNode::mergeValues.  Fix inconsistent return points.  [Security/Core] UserInterface::getPassword() can return null  cs fix  cs fix  Fix missing exporter in PHPUnit constraint poylfill  added `Process::getLastOutputTime()` method  [Router] Fix TraceableUrlMatcher behaviour with trailing slash  [HttpKernel] Remove outdated docblock comment  Fix handling for session parameters  Revert "bug#33092 [DependencyInjection] Improve an exception message (fabpot)"
@fabpotfabpot mentioned this pull requestAug 26, 2019
@fabpotfabpot deleted the container-better-error-message branchSeptember 6, 2019 10:41
hultberg pushed a commit to hultberg/symfony that referenced this pull requestSep 17, 2021
* 4.3:  cs fix  Fix inconsistent return points.  [Config] Add handling for ignored keys in ArrayNode::mergeValues.  Fix inconsistent return points.  [Security/Core] UserInterface::getPassword() can return null  [Router] Fix TraceableUrlMatcher behaviour with trailing slash  Revert "bugsymfony#33092 [DependencyInjection] Improve an exception message (fabpot)"
hultberg pushed a commit to hultberg/symfony that referenced this pull requestSep 17, 2021
* 4.4:  cs fix  Fix inconsistent return points.  [Config] Add handling for ignored keys in ArrayNode::mergeValues.  Fix inconsistent return points.  [Security/Core] UserInterface::getPassword() can return null  cs fix  cs fix  Fix missing exporter in PHPUnit constraint poylfill  added `Process::getLastOutputTime()` method  [Router] Fix TraceableUrlMatcher behaviour with trailing slash  [HttpKernel] Remove outdated docblock comment  Fix handling for session parameters  Revert "bugsymfony#33092 [DependencyInjection] Improve an exception message (fabpot)"
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

+1 more reviewer

@SimperfitSimperfitSimperfit approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

5 participants

@fabpot@ro0NL@nicolas-grekas@Simperfit@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp