[depre] Deprecate strict-types rules as risky and not practical#7523
Merged
TomasVotruba merged 7 commits intomainfrom Oct 21, 2025
Merged
[depre] Deprecate strict-types rules as risky and not practical#7523TomasVotruba merged 7 commits intomainfrom
TomasVotruba merged 7 commits intomainfrom
Conversation
7f08705 to
ac7227d
Compare
942cce2 to
636c14f
Compare
samsonasik
reviewed
Oct 22, 2025
| $node->cond, | ||
| $this->treatAsNonEmpty | ||
| throw new ShouldNotHappenException( | ||
| 'This rule is deprecated and will be removed as risky and requires manual checking' |
Member
There was a problem hiding this comment.
we don't know what "this rule" is, should mention self::class instead.
Member
Author
There was a problem hiding this comment.
What's the output error? I think deprecated rules are reported on Rector run.
Member
There was a problem hiding this comment.
this show:
"/home/runner/work/CodeIgniter4/CodeIgniter4/app/Config/Mimes.php"
file, due to:
"System error: "This rule is deprecated and will be removed as risky
and requires manual checking"
Run Rector with "--debug" option and post the report here: https://github.com/rectorphp/rector/issues/new". On line:
62
see https://github.com/codeigniter4/CodeIgniter4/actions/runs/18720569673/job/53391545753#step:12:48
Member
Author
Member
There was a problem hiding this comment.
I see, that seems fine then 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Revisiting couple rules I've added in #955 that are risky as assuming inner empty type. These rules were made to resolve https://github.com/phpstan/phpstan-strict-rules. As Rector moves to more practical rather academical area, these ruels would be best fit in own niche community ruleset.
Now we have better, more stable strategy to improve code quality like:
Those should be used instead to have upgrade path under control.
The only practical rule remains -
DisallowedEmptyRuleFixerRector. It might need split to multiple tailored rules, but works well for now. This one is already part of code quality set 👍