diff --git a/library/vendor/php-diff/SOURCE b/library/vendor/php-diff/SOURCE index c083b23c..91614885 100644 --- a/library/vendor/php-diff/SOURCE +++ b/library/vendor/php-diff/SOURCE @@ -1,9 +1,19 @@ +#!/bin/bash + +set -ex + +# version based on current master 3cb3f7ce6bb8b910f5a41ea1887b1faceba6a7d7 +# plus https://github.com/chrisboulton/php-diff/pull/50 git clone https://github.com/chrisboulton/php-diff.git -# Last used commit: + cd php-diff -git checkout f4db229d7ae8dffa0a4f90e1adbec9bf22c93d99 + +git fetch origin pull/50/head:pr +git checkout a9f124f81a9436138879e56157c6cced52a6d95b +git show -s + rm -rf .git rm -rf .gitignore rm -rf composer.json -rm -rf example +rm -rf example tests phpunit.xml cd .. diff --git a/library/vendor/php-diff/lib/Diff/Renderer/Html/Array.php b/library/vendor/php-diff/lib/Diff/Renderer/Html/Array.php index 76a314d6..521601c6 100644 --- a/library/vendor/php-diff/lib/Diff/Renderer/Html/Array.php +++ b/library/vendor/php-diff/lib/Diff/Renderer/Html/Array.php @@ -176,27 +176,21 @@ class Diff_Renderer_Html_Array extends Diff_Renderer_Abstract { $lines = array_map(array($this, 'ExpandTabs'), $lines); $lines = array_map(array($this, 'HtmlSafe'), $lines); - $callback = array($this, 'fixMatchedSpaces'); foreach($lines as &$line) { - // $line = preg_replace('# ( +)|^ #e', "\$this->fixSpaces('\\1')", $line); - $line = preg_replace_callback('# ( +)|^ #', $callback, $line); + $line = preg_replace_callback('# ( +)|^ #', array($this, 'fixSpaces'), $line); } return $lines; } - protected function fixMatchedSpaces($m) - { - return $this->fixSpaces($m[1]); - } - /** * Replace a string containing spaces with a HTML representation using . * - * @param string $spaces The string of spaces. + * @param string[] $matches Array with preg matches. * @return string The HTML representation of the string. */ - function fixSpaces($spaces='') + private function fixSpaces(array $matches) { + $spaces = $matches[1]; $count = strlen($spaces); if($count == 0) { return ''; diff --git a/library/vendor/php-diff/lib/Diff/Renderer/Html/Inline.php b/library/vendor/php-diff/lib/Diff/Renderer/Html/Inline.php index 60e8005a..a37fec66 100644 --- a/library/vendor/php-diff/lib/Diff/Renderer/Html/Inline.php +++ b/library/vendor/php-diff/lib/Diff/Renderer/Html/Inline.php @@ -128,8 +128,8 @@ class Diff_Renderer_Html_Inline extends Diff_Renderer_Html_Array foreach($change['changed']['lines'] as $no => $line) { $toLine = $change['changed']['offset'] + $no + 1; $html .= '