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 .= ''; - $html .= ''.$toLine.''; $html .= ' '; + $html .= ''.$toLine.''; $html .= ''.$line.''; $html .= ''; } @@ -140,4 +140,4 @@ class Diff_Renderer_Html_Inline extends Diff_Renderer_Html_Array $html .= ''; return $html; } -} \ No newline at end of file +} diff --git a/library/vendor/php-diff/lib/Diff/SequenceMatcher.php b/library/vendor/php-diff/lib/Diff/SequenceMatcher.php index e819e810..a289e391 100644 --- a/library/vendor/php-diff/lib/Diff/SequenceMatcher.php +++ b/library/vendor/php-diff/lib/Diff/SequenceMatcher.php @@ -50,12 +50,12 @@ class Diff_SequenceMatcher /** * @var array The first sequence to compare against. */ - private $a = null; + private $a = array(); /** * @var array The second sequence. */ - private $b = null; + private $b = array(); /** * @var array Array of characters that are considered junk from the second sequence. Characters are the array key. @@ -86,8 +86,8 @@ class Diff_SequenceMatcher */ public function __construct($a, $b, $junkCallback=null, $options) { - $this->a = null; - $this->b = null; + $this->a = array(); + $this->b = array(); $this->junkCallback = $junkCallback; $this->setOptions($options); $this->setSequences($a, $b); @@ -739,4 +739,4 @@ class Diff_SequenceMatcher return 1; } } -} \ No newline at end of file +}