php-diff icon indicating copy to clipboard operation
php-diff copied to clipboard

Fix deprecation warnings

Open TomA-R opened this issue 1 year ago • 3 comments

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

TomA-R avatar Dec 01 '24 01:12 TomA-R

Looks good to me.

TheWitness avatar Dec 01 '24 19:12 TheWitness

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.

jfcherng avatar Dec 01 '24 20:12 jfcherng

I just Emailed Chris to figure out what is going on.

TheWitness avatar Dec 01 '24 21:12 TheWitness