Skip to content

[php 8.1] skip nullable property without null default in NewInInitializerRector#7546

Merged
TomasVotruba merged 3 commits into
mainfrom
tv-new-init-skip-non-default
Oct 23, 2025
Merged

[php 8.1] skip nullable property without null default in NewInInitializerRector#7546
TomasVotruba merged 3 commits into
mainfrom
tv-new-init-skip-non-default

Conversation

@TomasVotruba
Copy link
Copy Markdown
Member

@TomasVotruba TomasVotruba commented Oct 23, 2025

No description provided.

@TomasVotruba TomasVotruba changed the title tv new init skip non default [php 8.1] skip nullable property without null default in NewInInitializerRector Oct 23, 2025
) {
$this->logger = $logger ?? new NullLogger();
}
}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samsonasik This is one of cases that would always throw error if upgraded.

Here, without null default, the null is always passed from outside to trigger:

new SkipIfNoDefaultNull(null); // only way to create NullLogger

Comment thread rules/Php81/Rector/ClassMethod/NewInInitializerRector.php Outdated
@TomasVotruba TomasVotruba force-pushed the tv-new-init-skip-non-default branch from 4caf859 to b91e37a Compare October 23, 2025 09:09
@TomasVotruba TomasVotruba force-pushed the tv-new-init-skip-non-default branch from 7618b53 to e0a05cb Compare October 23, 2025 09:12
@TomasVotruba TomasVotruba enabled auto-merge (squash) October 23, 2025 09:13
auto-merge was automatically disabled October 23, 2025 09:14

Head branch was modified

@TomasVotruba TomasVotruba merged commit f4f9196 into main Oct 23, 2025
52 checks passed
@TomasVotruba TomasVotruba deleted the tv-new-init-skip-non-default branch October 23, 2025 09:17
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 5, 2026

This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants