rector icon indicating copy to clipboard operation
rector copied to clipboard

Multiple depreciations under php 8.18

Open beeyev opened this issue 2 years ago • 2 comments

When I use the latest version of Rector 0.13.8 under php 8.18 I get these depreciation errors:

PHP Deprecated:  Return type of PHPUnit\Framework\TestCase::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /application/vendor/phpunit/phpunit/src/Framework/TestCase.php on line 374
Deprecated: Return type of PHPUnit\Framework\TestCase::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /application/vendor/phpunit/phpunit/src/Framework/TestCase.php on line 374

beeyev avatar Jul 21 '22 10:07 beeyev

That's seems not rector issue, but your vendor/phpunit. Looking at latest phpunit, it seems already return int:

https://github.com/sebastianbergmann/phpunit/blob/0cab10bdc4e44dbc65b0061230519f7255a61454/src/Framework/TestCase.php#L375

You may need to use latest phpunit. If the issue persist, please provide the reproducible repository for it, which showing that the issue only exists when it install along with rector, better with github action running.

samsonasik avatar Jul 21 '22 10:07 samsonasik

What phpunit version do you use?

TomasVotruba avatar Jul 21 '22 10:07 TomasVotruba

This has to be solved in PHPUnit itself :+1: Please report issue there.

TomasVotruba avatar Aug 17 '22 14:08 TomasVotruba