PHP Класс Generic_Sniffs_Formatting_MultipleStatementAlignmentSniff, PHP_CodeSniffer

Checks alignment of assignments. If there are multiple adjacent assignments, it will check that the equals signs of each assignment are aligned. It will display a warning to advise that the signs should be aligned.
Автор: Greg Sherwood ([email protected])
Автор: Marc McIntyre ([email protected])
Наследование: implements PHP_CodeSniffer_Sniff
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$error boolean If true, an error will be thrown; otherwise a warning.
$maxPadding integer If the amount of padding required to align this assignment with the surrounding assignments exceeds this number, the assignment will be ignored and no errors or warnings will be thrown.
$supportedTokenizers array A list of tokenizers this sniff supports.

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

Метод Описание
checkAlignment ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr ) : integer Processes this test, when one of its tokens is encountered.
process ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr ) : integer Processes this test, when one of its tokens is encountered.
register ( ) : array Returns an array of tokens this test wants to listen for.

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

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

Processes this test, when one of its tokens is encountered.
public checkAlignment ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr ) : integer
$phpcsFile PHP_CodeSniffer_File The file being scanned.
$stackPtr integer The position of the current token in the stack passed in $tokens.
Результат integer

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

Processes this test, when one of its tokens is encountered.
public process ( PHP_CodeSniffer_File $phpcsFile, integer $stackPtr ) : integer
$phpcsFile PHP_CodeSniffer_File The file being scanned.
$stackPtr integer The position of the current token in the stack passed in $tokens.
Результат integer

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

Returns an array of tokens this test wants to listen for.
public register ( ) : array
Результат array

Описание свойств

$error публичное свойство

If true, an error will be thrown; otherwise a warning.
public bool $error
Результат boolean

$maxPadding публичное свойство

If the amount of padding required to align this assignment with the surrounding assignments exceeds this number, the assignment will be ignored and no errors or warnings will be thrown.
public int $maxPadding
Результат integer

$supportedTokenizers публичное свойство

A list of tokenizers this sniff supports.
public array $supportedTokenizers
Результат array