Skip to content

Commit 357592e

Browse files
Merge branch '5.4' into 6.2
* 5.4: [PhpUnitBridge] Kill the last concurrent process when it stales for more than 60s [Intl] fix test [Intl] Use VarExporter::export() in PhpBundleWriter Use triggering class to generate baseline for deprecation messages from DebugClassLoader [Security] Fix false-string handling in RememberMeAuthenticator [CssSelector] Tests on Xpath translator will always pass [Serializer] Fix Normalizer not utilizing converted name for index variadic param [DepdencyInjection] Fix costly logic when checking errored definitions fix children cond [DoctrineBridge] Load refreshed user proxy [DependencyInjection] Don't ignore attributes on the actual decorator [FrameworkBundle] Prevent `cache:clear` to lose files on subsequent runs
2 parents 99753f0 + 386c948 commit 357592e

File tree

516 files changed

+58194
-58346
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

516 files changed

+58194
-58346
lines changed

Data/Bundle/Writer/PhpBundleWriter.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Intl\Data\Bundle\Writer;
1313

14+
use Symfony\Component\VarExporter\VarExporter;
15+
1416
/**
1517
* Writes .php resource bundles.
1618
*
@@ -39,14 +41,6 @@ public function write(string $path, string $locale, mixed $data)
3941
}
4042
});
4143

42-
$data = var_export($data, true);
43-
$data = preg_replace('/array \(/', '[', $data);
44-
$data = preg_replace('/\n {1,10}\[/', '[', $data);
45-
$data = preg_replace('/ /', ' ', $data);
46-
$data = preg_replace('/\),$/m', '],', $data);
47-
$data = preg_replace('/\)$/', ']', $data);
48-
$data = sprintf($template, $data);
49-
50-
file_put_contents($path.'/'.$locale.'.php', $data);
44+
file_put_contents($path.'/'.$locale.'.php', sprintf($template, VarExporter::export($data)));
5145
}
5246
}

0 commit comments

Comments
 (0)