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] EnvPlaceholderParameterBag::get() can't return UnitEnum#47635

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
nicolas-grekas merged 1 commit intosymfony:6.0fromphp-rock:bugfix/addUnitEnum61
Sep 26, 2022

Conversation

@php-rock
Copy link

@php-rockphp-rock commentedSep 20, 2022
edited by nicolas-grekas
Loading

QA
Branch?6.0
Bug fix?yes
New feature?no
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

This PR allows to get enums from container in the next situation:

parameters:    app.someEnum.yes !php/const \App\Context\SomeEnum::YES

Currently, we'll have an error:

[critical] Uncaught Error: Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag::get(): Return value must be of type array|string|int|float|bool|null, \App\Context\SomeEnum returned

This bugfix fixes this error.

EnvPlaceholderParameterBag::get() has a signature: array|bool|string|int|float|null
ParameterBag::get() has another signature: array|bool|string|int|float|\UnitEnum|null

Why do we need this fix?
To make the results of two dependent methods consistent.

EnvPlaceholderParameterBag::get() callParameterBag::get() here:https://github.com/symfony/symfony/blob/6.1/src/Symfony/Component/DependencyInjection/ParameterBag/EnvPlaceholderParameterBag.php#L61

This PR makes it consistent and adding UnitEnum toEnvPlaceholderParameterBag::get() result.

@carsonbotcarsonbot added this to the6.1 milestoneSep 20, 2022
@php-rockphp-rock changed the titleBugfix: EnvPlaceholderParameterBag::get() can't return UnitEnum (Symfony 6.1)[DependencyInjection] [Bugfix] EnvPlaceholderParameterBag::get() can't return UnitEnum (Symfony 6.1)Sep 20, 2022
@nicolas-grekasnicolas-grekas changed the title[DependencyInjection] [Bugfix] EnvPlaceholderParameterBag::get() can't return UnitEnum (Symfony 6.1)[DependencyInjection] EnvPlaceholderParameterBag::get() can't return UnitEnumSep 26, 2022
@nicolas-grekasnicolas-grekas modified the milestones:6.1,6.0Sep 26, 2022
@nicolas-grekas
Copy link
Member

Thank you@php-rock.

php-rock reacted with heart emoji

@nicolas-grekasnicolas-grekas merged commit540425a intosymfony:6.0Sep 26, 2022
This was referencedSep 30, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@xabbuhxabbuhAwaiting requested review from xabbuh

@lyrixxlyrixxAwaiting requested review from lyrixx

@dunglasdunglasAwaiting requested review from dunglas

@ycerutoycerutoAwaiting requested review from yceruto

@wouterjwouterjAwaiting requested review from wouterj

@chalasrchalasrAwaiting requested review from chalasr

@OskarStarkOskarStarkAwaiting requested review from OskarStark

@jderussejderusseAwaiting requested review from jderusse

Assignees

No one assigned

Projects

None yet

Milestone

6.0

Development

Successfully merging this pull request may close these issues.

3 participants

@php-rock@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp