ClassDefinitionFixer
extends AbstractFixer
in package
implements
ConfigurationDefinitionFixerInterface, WhitespacesAwareFixerInterface
Fixer for part of the rules defined in PSR2 ¶4.1 Extends and Implements and PSR12 ¶8. Anonymous Classes.
Tags
Interfaces, Classes and Traits
Table of Contents
- getDefinition() : mixed
- {@inheritdoc}
- getPriority() : mixed
- {@inheritdoc}
- isCandidate() : mixed
- {@inheritdoc}
- applyFix() : mixed
- {@inheritdoc}
- createConfigurationDefinition() : mixed
- {@inheritdoc}
- fixClassyDefinition() : mixed
- fixClassyDefinitionExtends() : array<string|int, mixed>
- fixClassyDefinitionImplements() : array<string|int, mixed>
- fixClassyDefinitionOpenSpacing() : int
- getClassyDefinitionInfo() : array<string|int, mixed>
- getClassyInheritanceInfo() : array<string|int, mixed>
- makeClassyDefinitionSingleLine() : mixed
- makeClassyInheritancePartMultiLine() : mixed
Methods
getDefinition()
{@inheritdoc}
public
getDefinition() : mixed
Return values
mixed —getPriority()
{@inheritdoc}
public
getPriority() : mixed
Must run before BracesFixer.
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 —fixClassyDefinition()
private
fixClassyDefinition(Tokens $tokens, int $classyIndex) : mixed
Parameters
- $tokens : Tokens
- $classyIndex : int
-
Class definition token start index
Return values
mixed —fixClassyDefinitionExtends()
private
fixClassyDefinitionExtends(Tokens $tokens, int $classOpenIndex, array<string|int, mixed> $classExtendsInfo) : array<string|int, mixed>
Parameters
- $tokens : Tokens
- $classOpenIndex : int
- $classExtendsInfo : array<string|int, mixed>
Return values
array<string|int, mixed> —fixClassyDefinitionImplements()
private
fixClassyDefinitionImplements(Tokens $tokens, int $classOpenIndex, array<string|int, mixed> $classImplementsInfo) : array<string|int, mixed>
Parameters
- $tokens : Tokens
- $classOpenIndex : int
- $classImplementsInfo : array<string|int, mixed>
Return values
array<string|int, mixed> —fixClassyDefinitionOpenSpacing()
private
fixClassyDefinitionOpenSpacing(Tokens $tokens, array<string|int, mixed> $classDefInfo) : int
Parameters
- $tokens : Tokens
- $classDefInfo : array<string|int, mixed>
Return values
int —getClassyDefinitionInfo()
private
getClassyDefinitionInfo(Tokens $tokens, int $classyIndex) : array<string|int, mixed>
Parameters
- $tokens : Tokens
- $classyIndex : int
Return values
array<string|int, mixed> —getClassyInheritanceInfo()
private
getClassyInheritanceInfo(Tokens $tokens, int $startIndex, string $label) : array<string|int, mixed>
Parameters
- $tokens : Tokens
- $startIndex : int
- $label : string
Return values
array<string|int, mixed> —makeClassyDefinitionSingleLine()
private
makeClassyDefinitionSingleLine(Tokens $tokens, int $startIndex, int $endIndex) : mixed
Parameters
- $tokens : Tokens
- $startIndex : int
- $endIndex : int
Return values
mixed —makeClassyInheritancePartMultiLine()
private
makeClassyInheritancePartMultiLine(Tokens $tokens, int $startIndex, int $endIndex) : mixed
Parameters
- $tokens : Tokens
- $startIndex : int
- $endIndex : int