summaryrefslogtreecommitdiff
path: root/framework/3rdParty
diff options
context:
space:
mode:
authorctrlaltca <ctrlaltca@gmail.com>2016-04-12 15:05:37 +0200
committerctrlaltca <ctrlaltca@gmail.com>2016-04-12 15:05:37 +0200
commit4cdb8c50f3467d8eaeac6c268242bcc6347add3b (patch)
tree6d2fbda87ae5c162731e6904a4a25772b3aef903 /framework/3rdParty
parentb4ed61bfeffee3a47e8b313f64cc7436a99cb460 (diff)
parentde868b371166a367b7e66307b6f90aee0da2bb8d (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.php8
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";
}