ClassAttributesSeparationFixer
extends AbstractFixer
in package
implements
ConfigurationDefinitionFixerInterface, WhitespacesAwareFixerInterface
Make sure there is one blank line above and below class elements.
The exception is when an element is the first or last item in a 'classy'.
Tags
Interfaces, Classes and Traits
Table of Contents
- $classElementTypes : array<string, string>
- configure() : mixed
- {@inheritdoc}
- getDefinition() : mixed
- {@inheritdoc}
- getPriority() : mixed
- {@inheritdoc}
- isCandidate() : mixed
- {@inheritdoc}
- applyFix() : mixed
- {@inheritdoc}
- createConfigurationDefinition() : mixed
- {@inheritdoc}
- correctLineBreaks() : mixed
- findAttributeBlockStart() : int
- findCommentBlockStart() : int
- fixSpaceAboveClassElement() : mixed
- Fix spacing above an element of a class, interface or trait.
- fixSpaceBelowClassElement() : mixed
- Fix spacing below an element of a class, interface or trait.
- fixSpaceBelowClassMethod() : mixed
- Fix spacing below a method of a class or trait.
- getLineBreakCount() : int
Properties
$classElementTypes
private
array<string, string>
$classElementTypes
= []
Methods
configure()
{@inheritdoc}
public
configure([array<string|int, mixed> $configuration = null ]) : mixed
Parameters
- $configuration : array<string|int, mixed> = null
Return values
mixed —getDefinition()
{@inheritdoc}
public
getDefinition() : mixed
Return values
mixed —getPriority()
{@inheritdoc}
public
getPriority() : mixed
Must run before BracesFixer, IndentationTypeFixer. Must run after OrderedClassElementsFixer, SingleClassElementPerStatementFixer.
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 —correctLineBreaks()
private
correctLineBreaks(Tokens $tokens, int $startIndex, int $endIndex[, int $reqLineCount = 2 ]) : mixed
Parameters
- $tokens : Tokens
- $startIndex : int
- $endIndex : int
- $reqLineCount : int = 2
Return values
mixed —findAttributeBlockStart()
private
findAttributeBlockStart(Tokens $tokens, int $index) : int
Parameters
- $tokens : Tokens
- $index : int
-
attribute close index
Return values
int —findCommentBlockStart()
private
findCommentBlockStart(Tokens $tokens, int $commentIndex) : int
Parameters
- $tokens : Tokens
- $commentIndex : int
Return values
int —fixSpaceAboveClassElement()
Fix spacing above an element of a class, interface or trait.
private
fixSpaceAboveClassElement(Tokens $tokens, int $classStartIndex, int $elementIndex, string $spacing) : mixed
Deals with comments, PHPDocs and spaces above the element with respect to the position of the element within the class, interface or trait.
Parameters
- $tokens : Tokens
- $classStartIndex : int
-
index of the class Token the element is in
- $elementIndex : int
-
index of the element to fix
- $spacing : string
Return values
mixed —fixSpaceBelowClassElement()
Fix spacing below an element of a class, interface or trait.
private
fixSpaceBelowClassElement(Tokens $tokens, int $classEndIndex, int $elementEndIndex, string $spacing) : mixed
Deals with comments, PHPDocs and spaces above the element with respect to the position of the element within the class, interface or trait.
Parameters
- $tokens : Tokens
- $classEndIndex : int
- $elementEndIndex : int
- $spacing : string
Return values
mixed —fixSpaceBelowClassMethod()
Fix spacing below a method of a class or trait.
private
fixSpaceBelowClassMethod(Tokens $tokens, int $classEndIndex, int $elementEndIndex, string $spacing) : mixed
Deals with comments, PHPDocs and spaces above the method with respect to the position of the method within the class or trait.
Parameters
- $tokens : Tokens
- $classEndIndex : int
- $elementEndIndex : int
- $spacing : string
Return values
mixed —getLineBreakCount()
private
getLineBreakCount(Tokens $tokens, int $whiteSpaceStartIndex, int $whiteSpaceEndIndex) : int
Parameters
- $tokens : Tokens
- $whiteSpaceStartIndex : int
- $whiteSpaceEndIndex : int