Skip to content

Commit b0638da

Browse files
Merge branch '6.1' into 6.2
* 6.1: [DI] fix tests [FrameworkBundle] fix merge [FrameworkBundle] Filter out trans paths that are covered by a parent folder path [Form] fix tests [Serializer] Fixed framework.serializer.default_context is not working for JsonEncoder [Ldap] Do not run ldap_set_option on failed connection Correct compare float data Bugfix: add \UnitEnum as a result of get() method Fix AbstractFormLoginAuthenticator return types (fixes #47571). Run composer with --ignore-platform-req=php+ [FrameworkBundle] Fix a phpdoc in mailer assertions
2 parents 4a10e29 + b9c797c commit b0638da

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

ParameterBag/EnvPlaceholderParameterBag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class EnvPlaceholderParameterBag extends ParameterBag
2626

2727
private static int $counter = 0;
2828

29-
public function get(string $name): array|bool|string|int|float|null
29+
public function get(string $name): array|bool|string|int|float|\UnitEnum|null
3030
{
3131
if (str_starts_with($name, 'env(') && str_ends_with($name, ')') && 'env()' !== $name) {
3232
$env = substr($name, 4, -1);

Tests/ParameterBag/EnvPlaceholderParameterBagTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,4 +206,12 @@ public function testExtraCharsInProcessor()
206206
$bag->resolve();
207207
$this->assertStringMatchesFormat('env_%s_key_a_b_c_FOO_%s', $bag->get('env(key:a.b-c:FOO)'));
208208
}
209+
210+
public function testGetEnum()
211+
{
212+
$bag = new EnvPlaceholderParameterBag();
213+
$bag->set('ENUM_VAR', StringBackedEnum::Bar);
214+
$this->assertInstanceOf(StringBackedEnum::class, $bag->get('ENUM_VAR'));
215+
$this->assertEquals(StringBackedEnum::Bar, $bag->get('ENUM_VAR'));
216+
}
209217
}

0 commit comments

Comments
 (0)