-
-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trigger Rectify #4997
Trigger Rectify #4997
Conversation
@@ -74,8 +74,11 @@ private function traverseForType(array $stmts, callable $callable, int $desiredT | |||
|
|||
$callable($useUse, $name); | |||
} | |||
|
|||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thats wrong. I intentionally left that out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since our logic here already traverses into such nodes, the traverser itself doesn't need todo it a second time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, reverted, I will test in other projects :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@staabm I am testing it, it cause overlapped type
diff --git a/rules/CodingStyle/ClassNameImport/ClassNameImportSkipper.php b/rules/CodingStyle/ClassNameImport/ClassNameImportSkipper.php
index 7e3b49fa0f..25e5d6c605 100644
--- a/rules/CodingStyle/ClassNameImport/ClassNameImportSkipper.php
+++ b/rules/CodingStyle/ClassNameImport/ClassNameImportSkipper.php
@@ -67,7 +67,7 @@ final class ClassNameImportSkipper
public function isFoundInUse(Name $name, array $uses): bool
{
$stringName = $name->toString();
- $nameLastName = strtolower($name->getLast());
+ $nameLastName = strtolower((string) $name->getLast());
when changing import type :), so return null seems needed, I will. create separate PR :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double run seems resolve it:
1) rules/CodingStyle/ClassNameImport/ClassNameImportSkipper.php:66
---------- begin diff ----------
@@ @@
public function isFoundInUse(Name $name, array $uses): bool
{
$stringName = $name->toString();
- $nameLastName = strtolower((string) $name->getLast());
+ $nameLastName = strtolower($name->getLast());
foreach ($uses as $use) {
$prefix = $this->useImportsResolver->resolvePrefix($use);
----------- end diff -----------
Applied rules:
* RecastingRemovalRector
I guess it is a glitch somewhere, actually, return null is fine, as the Use_
and GroupUse
actually has limited attributes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for testing.
would a return null
resolve these problems?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't 😁
It probably another problem with detecting type as mixed/errortype when docblock changed, probably related with @TomasVotruba change on:
which type now immediatelly got mixed when docblock changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@staabm I created new issue for it:
it may wait for @TomasVotruba work on :
for update docblock content right in the rule, which type currently goes mixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bc20873
to
c60b6cd
Compare
Trigger rectify from changes: