diff --git a/composer.json b/composer.json index 32bdc647..280c7701 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "phpstan/phpstan-webmozart-assert": "^2.0", "phpunit/phpunit": "^11.5", "rector/jack": "^0.5.1", - "rector/rector-src": "dev-main", + "rector/rector-src": "dev-bump-phpstan-226", "rector/swiss-knife": "^2.3", "rector/type-perfect": "^2.1", "symplify/easy-coding-standard": "^13.0", diff --git a/rules-tests/DowngradePhp80/Rector/FunctionLike/DowngradeUnionTypeDeclarationRector/Fixture/keep_nullable_trio_docblock.php.inc b/rules-tests/DowngradePhp80/Rector/FunctionLike/DowngradeUnionTypeDeclarationRector/Fixture/keep_nullable_trio_docblock.php.inc index dfa34a3a..5ef42348 100644 --- a/rules-tests/DowngradePhp80/Rector/FunctionLike/DowngradeUnionTypeDeclarationRector/Fixture/keep_nullable_trio_docblock.php.inc +++ b/rules-tests/DowngradePhp80/Rector/FunctionLike/DowngradeUnionTypeDeclarationRector/Fixture/keep_nullable_trio_docblock.php.inc @@ -16,7 +16,7 @@ namespace Rector\Tests\DowngradePhp80\Rector\FunctionLike\DowngradeUnionTypeDecl final class NullableTrioDocblock { /** - * @return int|string|null + * @return int|null|string */ public function run($value) { diff --git a/src/PhpDocDecorator/PhpDocFromTypeDeclarationDecorator.php b/src/PhpDocDecorator/PhpDocFromTypeDeclarationDecorator.php index 48753c50..47017883 100644 --- a/src/PhpDocDecorator/PhpDocFromTypeDeclarationDecorator.php +++ b/src/PhpDocDecorator/PhpDocFromTypeDeclarationDecorator.php @@ -41,23 +41,23 @@ /** * @see https://wiki.php.net/rfc/internal_method_return_types#proposal */ -final class PhpDocFromTypeDeclarationDecorator +final readonly class PhpDocFromTypeDeclarationDecorator { /** * @var ClassMethodWillChangeReturnType[] */ - private array $classMethodWillChangeReturnTypes = []; + private array $classMethodWillChangeReturnTypes; public function __construct( - private readonly StaticTypeMapper $staticTypeMapper, - private readonly PhpDocInfoFactory $phpDocInfoFactory, - private readonly NodeNameResolver $nodeNameResolver, - private readonly PhpDocTypeChanger $phpDocTypeChanger, - private readonly PhpAttributeGroupFactory $phpAttributeGroupFactory, - private readonly ReflectionResolver $reflectionResolver, - private readonly PhpAttributeAnalyzer $phpAttributeAnalyzer, - private readonly PhpVersionProvider $phpVersionProvider, - private readonly AstResolver $astResolver + private StaticTypeMapper $staticTypeMapper, + private PhpDocInfoFactory $phpDocInfoFactory, + private NodeNameResolver $nodeNameResolver, + private PhpDocTypeChanger $phpDocTypeChanger, + private PhpAttributeGroupFactory $phpAttributeGroupFactory, + private ReflectionResolver $reflectionResolver, + private PhpAttributeAnalyzer $phpAttributeAnalyzer, + private PhpVersionProvider $phpVersionProvider, + private AstResolver $astResolver ) { $this->classMethodWillChangeReturnTypes = [ // @todo how to make list complete? is the method list needed or can we use just class names?