Skip to content

Commit

Permalink
The /e modifier is deprecated, use preg_replace_callback instead
Browse files Browse the repository at this point in the history
  • Loading branch information
ftdebugger committed Aug 23, 2013
1 parent 23c299c commit 5b32c00
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/classmap_generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 5b32c00

Please sign in to comment.