Uh oh!
There was an error while loading. Please reload this page.
[TypeDeclaration] Handle skipped by file path on DeclareStrictTypesRector due to use beforeTraverse() - #5191
Conversation
samsonasik
commented
Oct 22, 2023
Fixed 🎉 /cc @kenjis |
samsonasik
commented
Oct 22, 2023
All checks have passed 🎉 @TomasVotruba it is ready for review. |
| parent::beforeTraverse($nodes); | ||
| $filePath = $this->file->getFilePath(); | ||
| if ($this->skipper->shouldSkipElementAndFilePath(self::class, $filePath)) { | ||
| return null; | ||
| } |
There was a problem hiding this comment.
This should be moved to AbstractRector::beforeTraverse() or similar, as rector rule itself should not decide about the sip.
There was a problem hiding this comment.
It can't, as AbstractRector::beforeTraverse() on setup File object, and re-called early in current parent::beforeTraverse(), moving to AbstractRector will require parent::beforeTraverse() to not called early, but after.
There was a problem hiding this comment.
I see. Let's go for it now then.
Bbut in case more rules will need the skip fix, we'll have to move it to single place outside specific rules.
TomasVotruba
commented
Oct 23, 2023
Thank you 👍 |
@kenjis this is for bug you found on CodeIgniter PR:
declare(strict_types=1)codeigniter4/CodeIgniter4#8072 (comment)which
DeclareStrictTypesRectordue to usebeforeTraverse()instead ofenterNode(), while onAbstractRector, checking skip is byenterNode()so it overlapped.