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

[Config] More accurate message on invalid config builder#40994

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
derrabus merged 1 commit intosymfony:5.xfroma-menshchikov:nested_bundle_config
May 2, 2021

Conversation

@a-menshchikov
Copy link
Contributor

QA
Branch?5.x
Bug fix?no
New feature?no
Deprecations?no
Tickets
LicenseMIT
Doc PR

Throw exception when trying to autowire nested bundle config instead of ConfigBuilder (related Doc PRsymfony/symfony-docs#15300).
Also renamed test class AcmeConfigBuilder to AcmeConfig according config builders auto naming.

Inspired by a chat with@Nyholm

@derrabusderrabus requested a review fromNyholmApril 29, 2021 21:03
@carsonbotcarsonbot changed the titleMore accurate message on invalid config builder[Config] More accurate message on invalid config builderApr 29, 2021
@derrabusderrabus added this to the5.3 milestoneApr 29, 2021
Copy link
Member

@NyholmNyholm left a comment

Choose a reason for hiding this comment

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

Thank you. Well done with the tests!

$alias = Container::underscore(substr($namespace,15, -6));

if (false !==strpos($alias,'\\')) {
thrownewInvalidArgumentException(sprintf('Nested bundle config class "%s" could not be handled.',$namespace));
Copy link
Member

Choose a reason for hiding this comment

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

Technically, we are not talking about "bundles" but "extensions".

Could we be more descriptive here?

Something more similar to this?

Could not find or generate class "%s". Make sure to use the "root" ConfigBuilder class. Ie use "Symfony\Config\FrameworkConfig" and not Symfony\Config\Framework\CacheConfig"

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I have tried to make message more descriptive, but without concrete classes.

Copy link
Member

Choose a reason for hiding this comment

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

Oh. I missed this comment.

I do agree that not usingSymfony\Config\Framework\CacheConfig may be better, but it is also very hard to understand what "nested classes" really mean. Im not sure that my suggestion is the best.

Throw exception when try to autowire nested bundle config instead of ConfigBuilder.Also renamed test class AcmeConfigBuilder to AcmeConfig according config builders auto naming.
Copy link
Member

@NyholmNyholm left a comment

Choose a reason for hiding this comment

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

Thank you

Im happy with this PR. I just had one small question left.

@derrabus
Copy link
Member

Thank you@a-menshchikov.

@derrabusderrabus merged commit9857fae intosymfony:5.xMay 2, 2021
@a-menshchikova-menshchikov deleted the nested_bundle_config branchMay 2, 2021 19:12
@fabpotfabpot mentioned this pull requestMay 9, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@NyholmNyholmNyholm approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

5.3

Development

Successfully merging this pull request may close these issues.

6 participants

@a-menshchikov@derrabus@nicolas-grekas@stof@Nyholm@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp