Skip to content

[Php74] Skip anonymous classes in RestoreDefaultNullToNullableTypePropertyRector#8104

Merged
TomasVotruba merged 1 commit into
mainfrom
skip-anon-class-restore-null-default
Jun 29, 2026
Merged

[Php74] Skip anonymous classes in RestoreDefaultNullToNullableTypePropertyRector#8104
TomasVotruba merged 1 commit into
mainfrom
skip-anon-class-restore-null-default

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

What

RestoreDefaultNullToNullableTypePropertyRector now bails early for anonymous classes:

public function refactor(Node $node): ?Node
{
    if ($node->isAnonymous()) {
        return null;
    }
    ...

Tests

Added skip_anonymous_class fixture (a new class { public ?string $name; } left unchanged). Full rule suite green (13 tests). ECS + PHPStan level 8 clean.

@TomasVotruba TomasVotruba force-pushed the skip-anon-class-restore-null-default branch 2 times, most recently from fa7f417 to ce34ac2 Compare June 29, 2026 08:18
@TomasVotruba TomasVotruba enabled auto-merge (squash) June 29, 2026 08:18
@TomasVotruba TomasVotruba merged commit 449db3f into main Jun 29, 2026
65 checks passed
@TomasVotruba TomasVotruba deleted the skip-anon-class-restore-null-default branch June 29, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant