function MultiLineFunctionDeclarationSniff::processSingleLineDeclaration
Same name in this branch
- 11.1.x vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php \PHP_CodeSniffer\Standards\Squiz\Sniffs\Functions\MultiLineFunctionDeclarationSniff::processSingleLineDeclaration()
Processes single-line declarations.
Just uses the Generic Kernighan Ritchie sniff.
Parameters
\PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.:
int $stackPtr The position of the current token: in the stack passed in $tokens.
array<int, array<string, mixed>> $tokens The stack of tokens that make up: the file.
Return value
void
Overrides MultiLineFunctionDeclarationSniff::processSingleLineDeclaration
File
-
vendor/
drupal/ coder/ coder_sniffer/ Drupal/ Sniffs/ Functions/ MultiLineFunctionDeclarationSniff.php, line 51
Class
- MultiLineFunctionDeclarationSniff
- Multi-line function declarations need to have a trailing comma on the last parameter. Modified from Squiz, whenever there is a function declaration closing parenthesis on a new line we treat it as multi-line.
Namespace
Drupal\Sniffs\FunctionsCode
public function processSingleLineDeclaration($phpcsFile, $stackPtr, $tokens) {
$sniff = new OpeningFunctionBraceKernighanRitchieSniff();
$sniff->checkClosures = true;
$sniff->process($phpcsFile, $stackPtr);
}