diff options
author | emkael <emkael@tlen.pl> | 2016-04-12 13:40:25 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2016-04-12 14:45:42 +0200 |
commit | afbc346926e2db1bfb50bd4cf5f5c57c69ea1c99 (patch) | |
tree | 45186d4ff968333f4d4ec79bda88eb02af59408b /framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer | |
parent | b4ed61bfeffee3a47e8b313f64cc7436a99cb460 (diff) |
Removing regex modifier deleted from PHP7
Diffstat (limited to 'framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer')
-rw-r--r-- | framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Console.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Console.php b/framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Console.php index 88d13761..1f4ec071 100644 --- a/framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Console.php +++ b/framework/3rdParty/TextHighlighter/Text/Highlighter/Renderer/Console.php @@ -179,7 +179,13 @@ class Text_Highlighter_Renderer_Console extends Text_Highlighter_Renderer $nlines = substr_count($this->_output, "\n") + 1; $len = strlen($nlines); $i = 1; - $this->_output = preg_replace('~^~em', '" " . str_pad($i++, $len, " ", STR_PAD_LEFT) . ": "', $this->_output); + $this->_output = preg_replace_callback( + '~^~m', + function($matches) use(&$i, $len) { + return " " . str_pad($i++, $len, " ", STR_PAD_LEFT) . ": "; + }, + $this->_output + ); } $this->_output .= HL_CONSOLE_DEFCOLOR . "\n"; } |