Add fix for container dump command

[MAILPOET-3239]
This commit is contained in:
Rostislav Wolny
2020-10-21 14:33:52 +02:00
committed by Veljko V
parent 85f56b2a6f
commit e1efa1e14e
2 changed files with 28 additions and 0 deletions

View File

@@ -34,6 +34,7 @@
"php fix-swiftmailer.php", "php fix-swiftmailer.php",
"php fix-validator.php", "php fix-validator.php",
"php fix-monolog.php", "php fix-monolog.php",
"php fix-symfony-di.php",
"php fix-symfony-polyfill.php" "php fix-symfony-polyfill.php"
] ]
}, },

View File

@@ -0,0 +1,27 @@
<?php
// throw exception if anything fails
set_error_handler(function ($severity, $message, $file, $line) {
throw new ErrorException($message, 0, $severity, $file, $line);
});
$replacements = [
// Replace usage of regexp from constant to avoid installing additional package symfony/config
// The symfony/config causes issues with serialization in integration tests
[
'file' => '../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);
}