Skip to content

[CodeQuality] Remove NarrowPreviousExceptionCodeArgRector - #9062

Merged
TomasVotruba merged 1 commit into
mainfrom
remove-narrow-previous-exception-code-arg
Nov 24, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
remove-narrow-previous-exception-code-arg

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Closes #9061

getCode() of the new exception does not fall back to the previous exception - it returns 0 when no code is passed. Removing the code argument changes behavior in every case where the previous code is not 0, so there is no safe subset to keep.

Removes the rule, its tests and its registration in the named-args set and CodeQualityLevel.

@TomasVotruba
TomasVotruba merged commit e821055 into main Nov 24, 2026
51 checks passed
@TomasVotruba
TomasVotruba deleted the remove-narrow-previous-exception-code-arg branch November 24, 2026 23:20
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.

NarrowPreviousExceptionCodeArgRector changes getCode() of the new exception to 0

1 participant