NoSuperfluousPhpdocTagsFixer
extends AbstractFixer
in package
implements
ConfigurationDefinitionFixerInterface
Interfaces, Classes and Traits
Table of Contents
- getDefinition() : mixed
- {@inheritdoc}
- getPriority() : mixed
- {@inheritdoc}
- isCandidate() : mixed
- {@inheritdoc}
- applyFix() : mixed
- {@inheritdoc}
- createConfigurationDefinition() : mixed
- {@inheritdoc}
- annotationIsSuperfluous() : bool
- findDocumentedElement() : null|int
- fixFunctionDocComment() : string
- fixPropertyDocComment() : string
- getArgumentsInfo() : array<string, array<string|int, mixed>>
- getPropertyTypeInfo() : array<string|int, mixed>
- getReturnTypeInfo() : mixed
- parseTypeHint() : array<string|int, mixed>
- removeSuperfluousInheritDoc() : string
- toComparableNames() : array<string|int, mixed>
- Normalizes types to make them comparable.
Methods
getDefinition()
{@inheritdoc}
public
getDefinition() : mixed
Return values
mixed —getPriority()
{@inheritdoc}
public
getPriority() : mixed
Must run before NoEmptyPhpdocFixer, PhpdocAlignFixer, VoidReturnFixer. Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, FullyQualifiedStrictTypesFixer, PhpdocAddMissingParamAnnotationFixer, PhpdocIndentFixer, PhpdocReturnSelfReferenceFixer, PhpdocScalarFixer, PhpdocToCommentFixer, PhpdocToParamTypeFixer, PhpdocToReturnTypeFixer, PhpdocTypesFixer.
Return values
mixed —isCandidate()
{@inheritdoc}
public
isCandidate(Tokens $tokens) : mixed
Parameters
- $tokens : Tokens
Return values
mixed —applyFix()
{@inheritdoc}
protected
applyFix(SplFileInfo $file, Tokens $tokens) : mixed
Parameters
- $file : SplFileInfo
- $tokens : Tokens
Return values
mixed —createConfigurationDefinition()
{@inheritdoc}
protected
createConfigurationDefinition() : mixed
Return values
mixed —annotationIsSuperfluous()
private
annotationIsSuperfluous(Annotation $annotation, array<string|int, mixed> $info, array<string, string> $symbolShortNames) : bool
Parameters
- $annotation : Annotation
- $info : array<string|int, mixed>
- $symbolShortNames : array<string, string>
Return values
bool —findDocumentedElement()
private
findDocumentedElement(Tokens $tokens, int $docCommentIndex) : null|int
Parameters
- $tokens : Tokens
- $docCommentIndex : int
Return values
null|int —fixFunctionDocComment()
private
fixFunctionDocComment(string $content, Tokens $tokens, int $functionIndex, array<string|int, mixed> $shortNames) : string
Parameters
- $content : string
- $tokens : Tokens
- $functionIndex : int
- $shortNames : array<string|int, mixed>
Return values
string —fixPropertyDocComment()
private
fixPropertyDocComment(string $content, Tokens $tokens, int $index, array<string|int, mixed> $shortNames) : string
Parameters
- $content : string
- $tokens : Tokens
- $index : int
-
Index of the DocComment token
- $shortNames : array<string|int, mixed>
Return values
string —getArgumentsInfo()
private
getArgumentsInfo(Tokens $tokens, int $start, int $end) : array<string, array<string|int, mixed>>
Parameters
- $tokens : Tokens
- $start : int
- $end : int
Return values
array<string, array<string|int, mixed>> —getPropertyTypeInfo()
private
getPropertyTypeInfo(Tokens $tokens, int $index) : array<string|int, mixed>
Parameters
- $tokens : Tokens
- $index : int
-
The index of the first token of the type hint
Return values
array<string|int, mixed> —getReturnTypeInfo()
private
getReturnTypeInfo(Tokens $tokens, mixed $closingParenthesisIndex) : mixed
Parameters
- $tokens : Tokens
- $closingParenthesisIndex : mixed
Return values
mixed —parseTypeHint()
private
parseTypeHint(Tokens $tokens, int $index) : array<string|int, mixed>
Parameters
- $tokens : Tokens
- $index : int
-
The index of the first token of the type hint
Return values
array<string|int, mixed> —removeSuperfluousInheritDoc()
private
removeSuperfluousInheritDoc(string $docComment) : string
Parameters
- $docComment : string
Return values
string —toComparableNames()
Normalizes types to make them comparable.
private
toComparableNames(array<string|int, string> $types, array<string, string> $symbolShortNames) : array<string|int, mixed>
Converts given types to lowercase, replaces imports aliases with their matching FQCN, and finally sorts the result.
Parameters
- $types : array<string|int, string>
-
The types to normalize
- $symbolShortNames : array<string, string>
-
The imports aliases
Return values
array<string|int, mixed> —The normalized types