PHP Interface PhpCsFixer\Fixer\FixerInterface

Author: Dariusz Rumiński ([email protected])
Author: Fabien Potencier ([email protected])
Afficher le fichier Open project: friendsofphp/php-cs-fixer Interface Usage Examples

Méthodes publiques

Méthode Description
fix ( SplFileInfo $file, Tokens $tokens ) Fixes a file.
getName ( ) : string Returns the name of the fixer.
getPriority ( ) : integer Returns the priority of the fixer.
isCandidate ( Tokens $tokens ) : boolean Check if the fixer is a candidate for given Tokens collection.
isRisky ( ) : boolean Check if fixer is risky or not.
supports ( SplFileInfo $file ) : boolean Returns true if the file is supported by this fixer.

Method Details

fix() public méthode

Fixes a file.
public fix ( SplFileInfo $file, Tokens $tokens )
$file SplFileInfo A \SplFileInfo instance
$tokens PhpCsFixer\Tokenizer\Tokens Tokens collection

getName() public méthode

The name must be all lowercase and without any spaces.
public getName ( ) : string
Résultat string The name of the fixer

getPriority() public méthode

The default priority is 0 and higher priorities are executed first.
public getPriority ( ) : integer
Résultat integer

isCandidate() public méthode

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.
public isCandidate ( Tokens $tokens ) : boolean
$tokens PhpCsFixer\Tokenizer\Tokens
Résultat boolean

isRisky() public méthode

Risky fixer could change code behavior!
public isRisky ( ) : boolean
Résultat boolean

supports() public méthode

Returns true if the file is supported by this fixer.
public supports ( SplFileInfo $file ) : boolean
$file SplFileInfo
Résultat boolean true if the file is supported by this fixer, false otherwise