From e1efa1e14e543991d19c7f586560844032f80b32 Mon Sep 17 00:00:00 2001 From: Rostislav Wolny Date: Wed, 21 Oct 2020 14:33:52 +0200 Subject: [PATCH] Add fix for container dump command [MAILPOET-3239] --- prefixer/composer.json | 1 + prefixer/fix-symfony-di.php | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 prefixer/fix-symfony-di.php diff --git a/prefixer/composer.json b/prefixer/composer.json index 9d9a0d7125..064d5fbe21 100644 --- a/prefixer/composer.json +++ b/prefixer/composer.json @@ -34,6 +34,7 @@ "php fix-swiftmailer.php", "php fix-validator.php", "php fix-monolog.php", + "php fix-symfony-di.php", "php fix-symfony-polyfill.php" ] }, diff --git a/prefixer/fix-symfony-di.php b/prefixer/fix-symfony-di.php new file mode 100644 index 0000000000..717bc19e8b --- /dev/null +++ b/prefixer/fix-symfony-di.php @@ -0,0 +1,27 @@ + '../vendor-prefixed/symfony/dependency-injection/Dumper/PhpDumper.php', + 'find' => [ + '\MailPoetVendor\Symfony\Component\DependencyInjection\Loader\FileLoader::ANONYMOUS_ID_REGEXP', + ], + 'replace' => [ + "'/^\\.\\d+_[^~]*+~[._a-zA-Z\\d]{7}$/'", + ], + ], +]; + +// Apply replacements +foreach ($replacements as $singleFile) { + $data = file_get_contents($singleFile['file']); + $data = str_replace($singleFile['find'], $singleFile['replace'], $data); + file_put_contents($singleFile['file'], $data); +}