MultilineWhitespaceBeforeSemicolonsFixer
extends AbstractFixer
in package
implements
ConfigurationDefinitionFixerInterface, WhitespacesAwareFixerInterface
Tags
Interfaces, Classes and Traits
Table of Contents
- getDefinition() : mixed
- {@inheritdoc}
- getPriority() : mixed
- {@inheritdoc}
- isCandidate() : mixed
- {@inheritdoc}
- applyFix() : mixed
- {@inheritdoc}
- createConfigurationDefinition() : mixed
- {@inheritdoc}
- applyChainedCallsFix() : mixed
- applyNoMultiLineFix() : mixed
- findWhitespaceBeforeFirstCall() : null|string
- Checks if the semicolon closes a chained call and returns the whitespace of the first call at $index.
- getIndentAt() : null|string
- getNewLineIndex() : int
- Find the index for the new line. Return the given index when there's no new line.
Methods
getDefinition()
{@inheritdoc}
public
getDefinition() : mixed
Return values
mixed —getPriority()
{@inheritdoc}
public
getPriority() : mixed
Must run before SpaceAfterSemicolonFixer. Must run after CombineConsecutiveIssetsFixer, NoEmptyStatementFixer, SingleImportPerStatementFixer.
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 —applyChainedCallsFix()
private
applyChainedCallsFix(Tokens $tokens) : mixed
Parameters
- $tokens : Tokens
Return values
mixed —applyNoMultiLineFix()
private
applyNoMultiLineFix(Tokens $tokens) : mixed
Parameters
- $tokens : Tokens
Return values
mixed —findWhitespaceBeforeFirstCall()
Checks if the semicolon closes a chained call and returns the whitespace of the first call at $index.
private
findWhitespaceBeforeFirstCall(int $index, Tokens $tokens) : null|string
i.e. it will return the whitespace marked with '____' in the example underneath.
.. ____$this->methodCall() ->anotherCall(); ..
Parameters
- $index : int
- $tokens : Tokens
Return values
null|string —getIndentAt()
private
getIndentAt(Tokens $tokens, int $index) : null|string
Parameters
- $tokens : Tokens
- $index : int
Return values
null|string —getNewLineIndex()
Find the index for the new line. Return the given index when there's no new line.
private
getNewLineIndex(int $index, Tokens $tokens) : int
Parameters
- $index : int
- $tokens : Tokens