Skip to content

Conversation

@TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented Oct 20, 2025

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 👍

@TomasVotruba TomasVotruba changed the title [depre] Deprecate BooleanInTernaryOperatorRuleFixerRector as risky and not used in any set [depre] Deprecate strict-types rules as risky and not used in any set Oct 20, 2025
@TomasVotruba TomasVotruba changed the title [depre] Deprecate strict-types rules as risky and not used in any set [depre] Deprecate strict-types rules as risky and not practical Oct 20, 2025
@TomasVotruba TomasVotruba merged commit 2cd301a into main Oct 21, 2025
52 checks passed
@TomasVotruba TomasVotruba deleted the tv-depre-strict branch October 21, 2025 08:32
$node->cond,
$this->treatAsNonEmpty
throw new ShouldNotHappenException(
'This rule is deprecated and will be removed as risky and requires manual checking'
Copy link
Member

Choose a reason for hiding this comment

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

we don't know what "this rule" is, should mention self::class instead.

Copy link
Member Author

@TomasVotruba TomasVotruba Oct 22, 2025

Choose a reason for hiding this comment

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

What's the output error? I think deprecated rules are reported on Rector run.

Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Last item:

Screenshot From 2025-10-22 17-51-17

Feel free to update the message though 👍

Copy link
Member

Choose a reason for hiding this comment

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

I see, that seems fine then 👍

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.

3 participants