Documentation

HeredocClosingMarkerFixer extends AbstractFixer
in package
implements ConfigurableFixerInterface uses ConfigurableFixerTrait

FinalYes
Tags
author

Michael Vorisek https://github.com/mvorisek

implements

ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>

phpstan-type

_AutogeneratedInputConfiguration array{ closing_marker?: string, explicit_heredoc_style?: bool, reserved_closing_markers?: list }

phpstan-type

_AutogeneratedComputedConfiguration array{ closing_marker: string, explicit_heredoc_style: bool, reserved_closing_markers: list }

Table of Contents

Interfaces

ConfigurableFixerInterface

Constants

RESERVED_CLOSING_MARKERS  = ['CSS', 'DIFF', 'HTML', 'JS', 'JSON', 'MD', 'PHP', 'PYTHON', 'RST', 'TS', 'SQL', 'XML', 'YAML']

Methods

getDefinition()  : FixerDefinitionInterface
Returns the definition of the fixer.
isCandidate()  : bool
Check if the fixer is a candidate for given Tokens collection.
applyFix()  : void
createConfigurationDefinition()  : FixerConfigurationResolverInterface
convertClosingMarker()  : Token}

Constants

RESERVED_CLOSING_MARKERS

public array<int, string> RESERVED_CLOSING_MARKERS = ['CSS', 'DIFF', 'HTML', 'JS', 'JSON', 'MD', 'PHP', 'PYTHON', 'RST', 'TS', 'SQL', 'XML', 'YAML']

Methods

isCandidate()

Check if the fixer is a candidate for given Tokens collection.

public isCandidate(Tokens $tokens) : bool

Fixer is a candidate when the collection contains tokens that may be fixed during fixer work. This could be considered as some kind of bloom filter. When this method returns true then to the Tokens collection may or may not need a fixing, but when this method returns false then the Tokens collection need no fixing for sure.

Parameters
$tokens : Tokens
Return values
bool

convertClosingMarker()

private convertClosingMarker(Token $startToken, Token $endToken, string $newClosingMarker) : Token}
Parameters
$startToken : Token
$endToken : Token
$newClosingMarker : string
Return values
Token}

        
On this page

Search results