PhpdocToParamTypeFixer
extends AbstractPhpdocToTypeDeclarationFixer
in package
Tags
Table of Contents
- $excludeFuncNames : mixed
- $skippedTypes : array<string, true>
- getDefinition() : mixed
- {@inheritdoc}
- getPriority() : mixed
- {@inheritdoc}
- isCandidate() : mixed
- {@inheritdoc}
- applyFix() : mixed
- {@inheritdoc}
- isSkippedType() : mixed
- findCorrectVariable() : null|int
- hasParamTypeHint() : bool
- Determine whether the function already has a param type hint.
Properties
$excludeFuncNames
private
mixed
$excludeFuncNames
= [[T_STRING, '__clone'], [T_STRING, '__destruct']]
$skippedTypes
private
array<string, true>
$skippedTypes
= ['mixed' => true, 'resource' => true, 'static' => true, 'void' => true]
Methods
getDefinition()
{@inheritdoc}
public
getDefinition() : mixed
Return values
mixed —getPriority()
{@inheritdoc}
public
getPriority() : mixed
Must run before NoSuperfluousPhpdocTagsFixer, PhpdocAlignFixer. Must run after AlignMultilineCommentFixer, CommentToPhpdocFixer, PhpdocIndentFixer, PhpdocScalarFixer, PhpdocToCommentFixer, 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 —isSkippedType()
protected
isSkippedType(mixed $type) : mixed
Parameters
- $type : mixed
Return values
mixed —findCorrectVariable()
private
findCorrectVariable(Tokens $tokens, int $startIndex, Annotation $paramTypeAnnotation) : null|int
Parameters
- $tokens : Tokens
- $startIndex : int
- $paramTypeAnnotation : Annotation
Return values
null|int —hasParamTypeHint()
Determine whether the function already has a param type hint.
private
hasParamTypeHint(Tokens $tokens, int $index) : bool
Parameters
- $tokens : Tokens
- $index : int
-
The index of the end of the function definition line, EG at { or ;