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] Builder: Remove typehints and allow for EnvConfigurator#40903

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.xfromNyholm:env-support
Apr 26, 2021

Conversation

@Nyholm
Copy link
Member

@NyholmNyholm commentedApr 22, 2021
edited
Loading

QA
Branch?5.x
Bug fix?yes -- maybe
New feature?no -- maybe =)
Deprecations?no
Tickets
LicenseMIT
Doc PR

Whenwriting documentation we found that we don't really support environment variables in the leaves. Ie, we expect a boolean but you provide"%env(ENABLE_FOO)%"

This PR will also introduceParamConfigurator to allow parameters to be passed as config.

The changes to the generated code:

    /**+    * @param bool|ParamConfigurator $value     * @default false     * @return $this     */-   public function enabled(bool $value): self+   public function enabled($value): self    {        $this->enabled = $value;            return $this;    }

@nicolas-grekas
Copy link
Member

This makes me realize that any%param% could also be allowed there, not only env ones.
This means we need to add a ParamConfigurator, and that EnvConfigurator should extend it.
Then, the param() function should return a ParamConfigurator.

@nicolas-grekasnicolas-grekas added this to the5.3 milestoneApr 22, 2021
@Nyholm
Copy link
MemberAuthor

Nyholm commentedApr 22, 2021
edited
Loading

I cannot figure out why I get this error:

1) Symfony\Component\Config\Tests\Builder\GeneratedConfigTest::testConfig with data set "Placeholders" ('Placeholders', 'placeholders')Error: Call to undefined function Symfony\Component\DependencyInjection\Loader\Configurator\env()src/Symfony/Component/Config/Tests/Builder/Fixtures/Placeholders.config.php:7src/Symfony/Component/Config/Tests/Builder/GeneratedConfigTest.php:50

@nicolas-grekas
Copy link
Member

nicolas-grekas commentedApr 22, 2021
edited
Loading

That's because the function is not autoloaded. This means that we should force-load ContainerConfigurator in the loader.

@Nyholm
Copy link
MemberAuthor

Nyholm commentedApr 22, 2021
edited
Loading

I tried that before, but I failed "force loading it". Hm.. it works now. I think I have to blame this on incompetence.

But this means that a user will have the same issues. Before the ConfigBuilders, this was not an issue because the user would always useContainerConfigurator.

@NyholmNyholmforce-pushed theenv-support branch 2 times, most recently from2a1e163 to77206e2CompareApril 22, 2021 13:14
@NyholmNyholm requested a review fromstofApril 22, 2021 13:14
Copy link
Contributor

@ro0NLro0NL left a comment

Choose a reason for hiding this comment

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

🚀

Nyholm reacted with rocket emoji
@Nyholm
Copy link
MemberAuthor

The PR is rebased. Travis and Fabbot are both reporting on unrelated issues.

@derrabus
Copy link
Member

Thank you Tobias.

@derrabusderrabus merged commit88abb39 intosymfony:5.xApr 26, 2021
@Nyholm
Copy link
MemberAuthor

Thank you for all the reviews and the merge.

@NyholmNyholm deleted the env-support branchApril 26, 2021 21:40
@fabpotfabpot mentioned this pull requestMay 1, 2021
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

@stofstofstof approved these changes

@derrabusderrabusderrabus approved these changes

+1 more reviewer

@ro0NLro0NLro0NL approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

5.3

Development

Successfully merging this pull request may close these issues.

6 participants

@Nyholm@nicolas-grekas@derrabus@stof@ro0NL@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp