Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@TomasVotruba
Copy link
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
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

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants