Skip to content
Permalink
Browse files

FIX: Remove deprecated assert() usage.

This stopped working in PHP 7.2
  • Loading branch information
sminnee committed Aug 15, 2017
1 parent 0926b04 commit 02cd72074835a61ce9f81db217f8f73d6687e8dd
Showing with 7 additions and 7 deletions.
  1. +7 −7 thirdparty/difflib/difflib.php
@@ -418,7 +418,7 @@ private function shift_boundaries($lines, &$changed, $other_changed)
$i = 0;
$j = 0;
assert('sizeof($lines) == sizeof($changed)');
assert(sizeof($lines) == sizeof($changed));
$len = sizeof($lines);
$other_len = sizeof($other_changed);
@@ -438,7 +438,7 @@ private function shift_boundaries($lines, &$changed, $other_changed)
$j++;
while ($i < $len && !$changed[$i]) {
assert('$j < $other_len && ! $other_changed[$j]');
assert($j < $other_len && ! $other_changed[$j]);
$i++;
$j++;
while ($j < $other_len && $other_changed[$j])
@@ -471,10 +471,10 @@ private function shift_boundaries($lines, &$changed, $other_changed)
$changed[--$i] = false;
while ($start > 0 && $changed[$start - 1])
$start--;
assert('$j > 0');
assert($j > 0);
while ($other_changed[--$j])
continue;
assert('$j >= 0 && !$other_changed[$j]');
assert($j >= 0 && !$other_changed[$j]);
}
/*
@@ -497,7 +497,7 @@ private function shift_boundaries($lines, &$changed, $other_changed)
while ($i < $len && $changed[$i])
$i++;
assert('$j < $other_len && ! $other_changed[$j]');
assert($j < $other_len && ! $other_changed[$j]);
$j++;
if ($j < $other_len && $other_changed[$j]) {
$corresponding = $i;
@@ -514,10 +514,10 @@ private function shift_boundaries($lines, &$changed, $other_changed)
while ($corresponding < $i) {
$changed[--$start] = 1;
$changed[--$i] = 0;
assert('$j > 0');
assert($j > 0);
while ($other_changed[--$j])
continue;
assert('$j >= 0 && !$other_changed[$j]');
assert($j >= 0 && !$other_changed[$j]);
}
}
}

0 comments on commit 02cd720

Please sign in to comment.
You can’t perform that action at this time.