Laravel 5.6 updates
Travis config update Removed HHVM script as Laravel no longer support HHVM after releasing 5.3
This commit is contained in:
@@ -5,10 +5,10 @@
|
||||
* PHP version 5
|
||||
*
|
||||
* Copyright (c) 2009 Chris Boulton <chris.boulton@interspire.com>
|
||||
*
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright notice,
|
||||
@@ -16,20 +16,20 @@
|
||||
* - Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* - Neither the name of the Chris Boulton nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* - Neither the name of the Chris Boulton nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* @package DiffLib
|
||||
@@ -82,12 +82,18 @@ class Diff_Renderer_Html_Array extends Diff_Renderer_Abstract
|
||||
|
||||
list($start, $end) = $this->getChangeExtent($fromLine, $toLine);
|
||||
if($start != 0 || $end != 0) {
|
||||
$last = $end + strlen($fromLine);
|
||||
$fromLine = substr_replace($fromLine, "\0", $start, 0);
|
||||
$fromLine = substr_replace($fromLine, "\1", $last + 1, 0);
|
||||
$last = $end + strlen($toLine);
|
||||
$toLine = substr_replace($toLine, "\0", $start, 0);
|
||||
$toLine = substr_replace($toLine, "\1", $last + 1, 0);
|
||||
$realEnd = mb_strlen($fromLine) + $end;
|
||||
$fromLine = mb_substr($fromLine, 0, $start)
|
||||
. "\0"
|
||||
. mb_substr($fromLine, $start, $realEnd - $start)
|
||||
. "\1"
|
||||
. mb_substr($fromLine, $realEnd);
|
||||
$realEnd = mb_strlen($toLine) + $end;
|
||||
$toLine = mb_substr($toLine, 0, $start)
|
||||
. "\0"
|
||||
. mb_substr($toLine, $start, $realEnd - $start)
|
||||
. "\1"
|
||||
. mb_substr($toLine, $realEnd);
|
||||
$a[$i1 + $i] = $fromLine;
|
||||
$b[$j1 + $i] = $toLine;
|
||||
}
|
||||
@@ -149,13 +155,13 @@ class Diff_Renderer_Html_Array extends Diff_Renderer_Abstract
|
||||
private function getChangeExtent($fromLine, $toLine)
|
||||
{
|
||||
$start = 0;
|
||||
$limit = min(strlen($fromLine), strlen($toLine));
|
||||
while($start < $limit && $fromLine{$start} == $toLine{$start}) {
|
||||
$limit = min(mb_strlen($fromLine), mb_strlen($toLine));
|
||||
while($start < $limit && mb_substr($fromLine, $start, 1) == mb_substr($toLine, $start, 1)) {
|
||||
++$start;
|
||||
}
|
||||
$end = -1;
|
||||
$limit = $limit - $start;
|
||||
while(-$end <= $limit && substr($fromLine, $end, 1) == substr($toLine, $end, 1)) {
|
||||
while(-$end <= $limit && mb_substr($fromLine, $end, 1) == mb_substr($toLine, $end, 1)) {
|
||||
--$end;
|
||||
}
|
||||
return array(
|
||||
@@ -174,7 +180,9 @@ class Diff_Renderer_Html_Array extends Diff_Renderer_Abstract
|
||||
*/
|
||||
private function formatLines($lines)
|
||||
{
|
||||
$lines = array_map(array($this, 'ExpandTabs'), $lines);
|
||||
if ($this->options['tabSize'] !== false) {
|
||||
$lines = array_map(array($this, 'ExpandTabs'), $lines);
|
||||
}
|
||||
$lines = array_map(array($this, 'HtmlSafe'), $lines);
|
||||
foreach($lines as &$line) {
|
||||
$line = preg_replace_callback('# ( +)|^ #', __CLASS__."::fixSpaces", $line);
|
||||
@@ -222,4 +230,4 @@ class Diff_Renderer_Html_Array extends Diff_Renderer_Abstract
|
||||
{
|
||||
return htmlspecialchars($string, ENT_NOQUOTES, 'UTF-8');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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 .= '<tr>';
|
||||
$html .= '<th>'.$toLine.'</th>';
|
||||
$html .= '<th> </th>';
|
||||
$html .= '<th>'.$toLine.'</th>';
|
||||
$html .= '<td class="Right"><span>'.$line.'</span></td>';
|
||||
$html .= '</tr>';
|
||||
}
|
||||
|
@@ -83,9 +83,9 @@ class Diff_Renderer_Html_SideBySide extends Diff_Renderer_Html_Array
|
||||
$toLine = $change['changed']['offset'] + $no + 1;
|
||||
$html .= '<tr>';
|
||||
$html .= '<th>'.$fromLine.'</th>';
|
||||
$html .= '<td class="Left"><span>'.$line.'</span> </span></td>';
|
||||
$html .= '<td class="Left"><span>'.$line.'</span> </td>';
|
||||
$html .= '<th>'.$toLine.'</th>';
|
||||
$html .= '<td class="Right"><span>'.$line.'</span> </span></td>';
|
||||
$html .= '<td class="Right"><span>'.$line.'</span> </td>';
|
||||
$html .= '</tr>';
|
||||
}
|
||||
}
|
||||
|
@@ -72,17 +72,17 @@ class Diff_Renderer_Text_Context extends Diff_Renderer_Abstract
|
||||
$j2 = $group[$lastItem][4];
|
||||
|
||||
if($i2 - $i1 >= 2) {
|
||||
$diff .= '*** '.($group[0][1] + 1).','.$i2." ****\n";
|
||||
$diff .= '*** '.($group[0][1] + 1).','.$i2." ****".PHP_EOL;
|
||||
}
|
||||
else {
|
||||
$diff .= '*** '.$i2." ****\n";
|
||||
}
|
||||
|
||||
if($j2 - $j1 >= 2) {
|
||||
$separator = '--- '.($j1 + 1).','.$j2." ----\n";
|
||||
$separator = '--- '.($j1 + 1).','.$j2." ----".PHP_EOL;
|
||||
}
|
||||
else {
|
||||
$separator = '--- '.$j2." ----\n";
|
||||
$separator = '--- '.$j2." ----".PHP_EOL;
|
||||
}
|
||||
|
||||
$hasVisible = false;
|
||||
@@ -99,7 +99,7 @@ class Diff_Renderer_Text_Context extends Diff_Renderer_Abstract
|
||||
if($tag == 'insert') {
|
||||
continue;
|
||||
}
|
||||
$diff .= $this->tagMap[$tag].' '.implode("\n".$this->tagMap[$tag].' ', $this->diff->GetA($i1, $i2))."\n";
|
||||
$diff .= $this->tagMap[$tag].' '.implode(PHP_EOL.$this->tagMap[$tag].' ', $this->diff->GetA($i1, $i2)).PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ class Diff_Renderer_Text_Context extends Diff_Renderer_Abstract
|
||||
if($tag == 'delete') {
|
||||
continue;
|
||||
}
|
||||
$diff .= $this->tagMap[$tag].' '.implode("\n".$this->tagMap[$tag].' ', $this->diff->GetB($j1, $j2))."\n";
|
||||
$diff .= $this->tagMap[$tag].' '.implode(PHP_EOL.$this->tagMap[$tag].' ', $this->diff->GetB($j1, $j2)).PHP_EOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -65,19 +65,19 @@ class Diff_Renderer_Text_Unified extends Diff_Renderer_Abstract
|
||||
$i2 = -1;
|
||||
}
|
||||
|
||||
$diff .= '@@ -'.($i1 + 1).','.($i2 - $i1).' +'.($j1 + 1).','.($j2 - $j1)." @@\n";
|
||||
$diff .= '@@ -'.($i1 + 1).','.($i2 - $i1).' +'.($j1 + 1).','.($j2 - $j1)." @@".PHP_EOL;
|
||||
foreach($group as $code) {
|
||||
list($tag, $i1, $i2, $j1, $j2) = $code;
|
||||
if($tag == 'equal') {
|
||||
$diff .= ' '.implode("\n ", $this->diff->GetA($i1, $i2))."\n";
|
||||
$diff .= ' '.implode(PHP_EOL." ", $this->diff->GetA($i1, $i2)).PHP_EOL;
|
||||
}
|
||||
else {
|
||||
if($tag == 'replace' || $tag == 'delete') {
|
||||
$diff .= '-'.implode("\n-", $this->diff->GetA($i1, $i2))."\n";
|
||||
$diff .= '-'.implode(PHP_EOL."-", $this->diff->GetA($i1, $i2)).PHP_EOL;
|
||||
}
|
||||
|
||||
if($tag == 'replace' || $tag == 'insert') {
|
||||
$diff .= '+'.implode("\n+", $this->diff->GetB($j1, $j2))."\n";
|
||||
$diff .= '+'.implode(PHP_EOL."+", $this->diff->GetB($j1, $j2)).PHP_EOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -69,6 +69,10 @@ class Diff_SequenceMatcher
|
||||
|
||||
private $options = array();
|
||||
|
||||
private $matchingBlocks = null;
|
||||
private $opCodes = null;
|
||||
private $fullBCount = null;
|
||||
|
||||
private $defaultOptions = array(
|
||||
'ignoreNewLines' => false,
|
||||
'ignoreWhitespace' => false,
|
||||
@@ -217,7 +221,7 @@ class Diff_SequenceMatcher
|
||||
*/
|
||||
private function isBJunk($b)
|
||||
{
|
||||
if(isset($this->juncDict[$b])) {
|
||||
if(isset($this->junkDict[$b])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -258,7 +262,7 @@ class Diff_SequenceMatcher
|
||||
for($i = $alo; $i < $ahi; ++$i) {
|
||||
$newJ2Len = array();
|
||||
$jDict = $this->arrayGetDefault($this->b2j, $a[$i], $nothing);
|
||||
foreach($jDict as $jKey => $j) {
|
||||
foreach($jDict as $j) {
|
||||
if($j < $blo) {
|
||||
continue;
|
||||
}
|
||||
@@ -291,7 +295,7 @@ class Diff_SequenceMatcher
|
||||
}
|
||||
|
||||
while($bestI > $alo && $bestJ > $blo && $this->isBJunk($b[$bestJ - 1]) &&
|
||||
!$this->isLineDifferent($bestI - 1, $bestJ - 1)) {
|
||||
!$this->linesAreDifferent($bestI - 1, $bestJ - 1)) {
|
||||
--$bestI;
|
||||
--$bestJ;
|
||||
++$bestSize;
|
||||
@@ -745,4 +749,4 @@ class Diff_SequenceMatcher
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user