EchoTagSyntaxFixer
extends AbstractFixer
in package
implements
ConfigurationDefinitionFixerInterface
Tags
Interfaces, Classes and Traits
Table of Contents
- getDefinition() : mixed
- {@inheritdoc}
- getPriority() : mixed
- {@inheritdoc}
- isCandidate() : mixed
- {@inheritdoc}
- applyFix() : mixed
- {@inheritdoc}
- createConfigurationDefinition() : mixed
- {@inheritdoc}
- buildLongToShortTokens() : array<string|int, Token>
- Builds the list of tokens that replace a long echo sequence.
- isComplexCode() : bool
- Check if $tokens, starting at $index, contains "complex code", that is, the content of the echo tag contains more than a simple "echo something".
- longToShort() : mixed
- shortToLong() : mixed
Methods
getDefinition()
{@inheritdoc}
public
getDefinition() : mixed
Return values
mixed —getPriority()
{@inheritdoc}
public
getPriority() : mixed
Must run before NoMixedEchoPrintFixer.
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 —buildLongToShortTokens()
Builds the list of tokens that replace a long echo sequence.
private
buildLongToShortTokens(Tokens $tokens, int $openTagIndex, int $echoTagIndex) : array<string|int, Token>
Parameters
- $tokens : Tokens
- $openTagIndex : int
- $echoTagIndex : int
Return values
array<string|int, Token> —isComplexCode()
Check if $tokens, starting at $index, contains "complex code", that is, the content of the echo tag contains more than a simple "echo something".
private
isComplexCode(Tokens $tokens, int $index) : bool
This is done by a very quick test: if the tag contains non-whitespace tokens after a semicolon, we consider it as "complex".
Parameters
- $tokens : Tokens
- $index : int
Tags
Return values
bool —longToShort()
private
longToShort(Tokens $tokens) : mixed
Parameters
- $tokens : Tokens
Return values
mixed —shortToLong()
private
shortToLong(Tokens $tokens) : mixed
Parameters
- $tokens : Tokens