8000 bug #48968 [VarExporter] Fix exporting enums (nicolas-grekas) · symfony/symfony@7ed818b · GitHub
[go: up one dir, main page]

Skip to content

Commit 7ed818b

Browse files
bug #48968 [VarExporter] Fix exporting enums (nicolas-grekas)
This PR was merged into the 5.4 branch. Discussion ---------- [VarExporter] Fix exporting enums | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #48967 | License | MIT | Doc PR | - Commits ------- 4574d87 [VarExporter] Fix exporting enums
2 parents 8cf82db + 4574d87 commit 7ed818b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/VarExporter/Internal/Exporter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public static function export($value, string $indent = '')
198198
case true === $value: return 'true';
199199
case null === $value: return 'null';
200200
case '' === $value: return "''";
201-
case $value instanceof \UnitEnum: return ltrim(var_export($value, true), '\\');
201+
case $value instanceof \UnitEnum: return '\\'.ltrim(var_export($value, true), '\\');
202202
}
203203

204204
if ($value instanceof Reference) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
22

33
return [
4-
Symfony\Component\VarExporter\Tests\Fixtures\FooUnitEnum::Bar,
4+
\Symfony\Component\VarExporter\Tests\Fixtures\FooUnitEnum::Bar,
55
];

0 commit comments

Comments
 (0)
0