-
Notifications
You must be signed in to change notification settings - Fork 27
[Arrows] MC-21844: SVC false-positive: short names & FQCN in DockBlock #51
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
Conversation
@roribio could you please take a look at our PR |
{ | ||
$return = parent::enterNode($node); | ||
|
||
if ($node instanceof ClassMethod) { |
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.
Property
, ClassConst
also may have annotation that describes a type. For Magento this is a less important cases and may be addressed in separate PRs.
src/Visitor/NameResolver.php
Outdated
if ($docNode) { | ||
$result = []; | ||
/** @var PhpDocTagNode[] $paramTags */ | ||
$paramTags = $docNode->getTagsByName('@param'); |
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.
Note: getParamTagValues
returns node with more suitable API
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.
fixed
src/Visitor/NameResolver.php
Outdated
} | ||
|
||
/** @var PhpDocTagNode[] $returnTags */ | ||
$returnTags = $docNode->getTagsByName('@return'); |
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.
Note: getReturnTagValues
returns node with more suitable API
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.
fixed
$resolvedType = $this->resolveType($normalizedType); | ||
$result[] = $resolvedType; | ||
} | ||
} else { |
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.
Note: Please ensure that PHPStan\PhpDocParser\Ast\Type\NullableTypeNode
should not be handled as special case (equals to union null|type
)
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.
?type is parsed as NullableType
type|null is parsed as UnionType
So I handle only UnionType case as list of FullyQualified types because there can be also annotation like that
Product|int|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.
Please fix unit test
@vkublytskyi all fixed except constants and variable types parsing |
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.
Approved 💯
Revert "Add enum to visitor"
Scope
Bug - P1
Bamboo CI builds
Related Pull Requests
Created by : @zakdma