php-diff
php-diff copied to clipboard
Fix deprecation warnings
Fixes
Fixes deprecation warnings:
PHP Deprecated: Diff_SequenceMatcher::__construct(): Optional parameter $junkCallback declared before required parameter $options is implicitly treated as a required parameter in php-diff/lib/Diff/SequenceMatcher.php on line 87
PHP Deprecated: Creation of dynamic property Diff_SequenceMatcher::$matchingBlocks is deprecated in php-diff/lib/Diff/SequenceMatcher.php on line 129
PHP Deprecated: Creation of dynamic property Diff_SequenceMatcher::$opCodes is deprecated in php-diff/lib/Diff/SequenceMatcher.php on line 130
PHP Deprecated: Creation of dynamic property Diff_SequenceMatcher::$matchingBlocks is deprecated in php-diff/lib/Diff/SequenceMatcher.php on line 129
PHP Deprecated: Creation of dynamic property Diff_SequenceMatcher::$opCodes is deprecated in php-diff/lib/Diff/SequenceMatcher.php on line 130
PHP Deprecated: Creation of dynamic property Diff_SequenceMatcher::$fullBCount is deprecated in php-diff/lib/Diff/SequenceMatcher.php on line 151
Fixes error:
TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given
php-diff/lib/Diff/SequenceMatcher.php:353
php-diff/lib/Diff/SequenceMatcher.php:467
php-diff/lib/Diff/SequenceMatcher.php:523
php-diff/lib/Diff.php:176
php-diff/lib/Diff/Renderer/Html/Array.php:70
php-diff/tests/Diff/Renderer/Html/ArrayTest.php:17
Fixes composer email address which caused composer install to fail:
$ composer install
In Factory.php line 317:
"./composer.json" does not match the expected JSON schema:
- authors[0].email : Invalid email
Upgrades PHPUnit so a version that can be installed on current versions of PHP
Why
To support newer versions of PHP without producing a lot of warnings
ping @chrisboulton
Looks good to me.
It would be better to set php version constraint in composer.json if you are going to use new features. I have my own modern replacement though.
I just Emailed Chris to figure out what is going on.