PHP Интерфейс PhpCsFixer\Fixer\FixerInterface

Автор: Dariusz Rumiński ([email protected])
Автор: Fabien Potencier ([email protected])
Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
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.

Описание методов

fix() публичный Метод

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

getName() публичный Метод

The name must be all lowercase and without any spaces.
public getName ( ) : string
Результат string The name of the fixer

getPriority() публичный Метод

The default priority is 0 and higher priorities are executed first.
public getPriority ( ) : integer
Результат integer

isCandidate() публичный Метод

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
Результат boolean

isRisky() публичный Метод

Risky fixer could change code behavior!
public isRisky ( ) : boolean
Результат boolean

supports() публичный Метод

Returns true if the file is supported by this fixer.
public supports ( SplFileInfo $file ) : boolean
$file SplFileInfo
Результат boolean true if the file is supported by this fixer, false otherwise