Documentation

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
author

SpacePossum

Interfaces, Classes and Traits

ConfigurationDefinitionFixerInterface
WhitespacesAwareFixerInterface

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

Methods

configure()

{@inheritdoc}

public configure([array<string|int, mixed> $configuration = null ]) : mixed
Parameters
$configuration : array<string|int, mixed> = null
Return values
mixed

getPriority()

{@inheritdoc}

public getPriority() : mixed

Must run before BracesFixer, IndentationTypeFixer. Must run after OrderedClassElementsFixer, SingleClassElementPerStatementFixer.

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

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
Return values
int

Search results