From 5b32c00b00ad392c0d3b390667715b3432fde751 Mon Sep 17 00:00:00 2001 From: Evgeny Shpilevsky Date: Fri, 23 Aug 2013 14:44:50 +0300 Subject: [PATCH] The /e modifier is deprecated, use preg_replace_callback instead --- bin/classmap_generator.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/classmap_generator.php b/bin/classmap_generator.php index ea3f8d60310..bfd5eb8ff6f 100755 --- a/bin/classmap_generator.php +++ b/bin/classmap_generator.php @@ -228,7 +228,13 @@ $maxWidth = max($maxWidth, strlen($match[1])); } -$content = preg_replace('(\n\s+([^=]+)=>)e', "'\n \\1' . str_repeat(' ', " . $maxWidth . " - strlen('\\1')) . '=>'", $content); +$content = preg_replace_callback( + '(\n\s+([^=]+)=>)', + function ($match) use ($maxWidth) { + return "\n " . $match[1] . str_repeat(" ", $maxWidth - strlen($match[1])) . '=>'; + }, + $content +); // Make the file end by EOL $content = rtrim($content, "\n") . "\n";