diff options
author | ctrlaltca <ctrlaltca@gmail.com> | 2016-04-12 15:05:37 +0200 |
---|---|---|
committer | ctrlaltca <ctrlaltca@gmail.com> | 2016-04-12 15:05:37 +0200 |
commit | 4cdb8c50f3467d8eaeac6c268242bcc6347add3b (patch) | |
tree | 6d2fbda87ae5c162731e6904a4a25772b3aef903 /framework/3rdParty | |
parent | b4ed61bfeffee3a47e8b313f64cc7436a99cb460 (diff) | |
parent | de868b371166a367b7e66307b6f90aee0da2bb8d (diff) |
Merge pull request #587 from emkael/master
PHP7 compatibility fixes
Diffstat (limited to 'framework/3rdParty')
-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"; } |