driftingly / rector-laravel

Rector upgrades rules for Laravel
http://getrector.org
MIT License
500 stars 49 forks source link

Error with change property visibility #145

Closed R1KO closed 6 months ago

R1KO commented 11 months ago

Hello

When i use dev-main branch, i receive this error:

./vendor/bin/rector --dry-run
Fatal error: Cannot redeclare non-readonly property Rector\Core\Rector\AbstractRector::$phpDocInfoFactory as readonly RectorLaravel\Rector\ClassMethod\AddGenericReturnTypeToRelationsRector::$phpDocInfoFactory in /var/www/api/vendor/driftingly/rector-laravel/src/Rector/ClassMethod/AddGenericReturnTypeToRelationsRector.php on line 30

but when i use 0.26.1 version then error:

Fatal error: Access level to RectorLaravel\Rector\ClassMethod\AddGenericReturnTypeToRelationsRector::$phpDocInfoFactory must be protected (as in class Rector\Core\Rector\AbstractRector) or weaker in /var/www/api/vendor/driftingly/rector-laravel/src/Rector/ClassMethod/AddGenericReturnTypeToRelationsRector.php on line 30

PHP 8.1 Laravel 10.0

GeniJaho commented 6 months ago

This was caused by differences and changes in the core Rector repo and has since been fixed in the 0.26.* releases, or at least before 1.0.