Exclude class methods with inheritdoc for Type rules #18
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.
@inheritdoc
class methods by excluding them. See why below.Why exclude class methods that have
{@inheritDoc}
tag?Without this PR, when the rules UseTypeHintForNewMethodsRule and seTypedReturnForNewMethodsRule find a class method without typed parameters and type return, they consider it a violation.
When we encounter a class method with
{@inheritDoc}
though, it indicates it extends a parent method.If parent method
If the parent method is not part of the exclusion list and is part of PrestaShop code, the UseTypeHintForNewMethodsRule and seTypedReturnForNewMethodsRule will also find it and flag it as a violation!
So we can safely say "if this method has has
{@inheritDoc}
tag, then either the parent method tag will be flagged invalid as well or we can assume it's not a violation". This is why we can ignore them.