Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warnings #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"authors": [
{
"name": "Chris Boulton",
"email": "@chrisboulton"
"email": "chris@chrisboulton.no-email"
}
],
"autoload": {
Expand All @@ -14,6 +14,6 @@
}
},
"require-dev": {
"phpunit/phpunit": "~5.5"
"phpunit/phpunit": "~8"
}
}
23 changes: 19 additions & 4 deletions lib/Diff/SequenceMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,21 @@ class Diff_SequenceMatcher
'ignoreCase' => false
);

/**
* @var array|null
*/
private $matchingBlocks;

/**
* @var array|null
*/
private $opCodes;

/**
* @var array|null
*/
private $fullBCount;

/**
* The constructor. With the sequences being passed, they'll be set for the
* sequence matcher and it will perform a basic cleanup & calculate junk
Expand All @@ -84,7 +99,7 @@ class Diff_SequenceMatcher
* @param string|array $b A string or array containing the lines to compare.
* @param string|array $junkCallback Either an array or string that references a callback function (if there is one) to determine 'junk' characters.
*/
public function __construct($a, $b, $junkCallback=null, $options)
public function __construct($a, $b, $junkCallback, $options)
{
$this->a = null;
$this->b = null;
Expand Down Expand Up @@ -349,8 +364,8 @@ public function getMatchingBlocks()
return $this->matchingBlocks;
}

$aLength = count($this->a);
$bLength = count($this->b);
$aLength = count($this->a ?? []);
$bLength = count($this->b ?? []);

$queue = array(
array(
Expand Down Expand Up @@ -739,4 +754,4 @@ private function tupleSort($a, $b)
return 1;
}
}
}
}
4 changes: 3 additions & 1 deletion tests/Diff/Renderer/Html/ArrayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Tests\Diff\Renderer\Html;

class ArrayTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class ArrayTest extends TestCase
{
public function testRenderSimpleDelete()
{
Expand Down