function FunctionDeclarationSniff::processSingleLineDeclaration
Processes single-line declarations.
Just uses the Generic BSD-Allman brace 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 $tokens The stack of tokens that make up: the file.
Return value
void
3 calls to FunctionDeclarationSniff::processSingleLineDeclaration()
- FunctionDeclarationSniff::process in vendor/
squizlabs/ php_codesniffer/ src/ Standards/ PEAR/ Sniffs/ Functions/ FunctionDeclarationSniff.php - Processes this test, when one of its tokens is encountered.
- MultiLineFunctionDeclarationSniff::processSingleLineDeclaration in vendor/
squizlabs/ php_codesniffer/ src/ Standards/ Squiz/ Sniffs/ Functions/ MultiLineFunctionDeclarationSniff.php - Processes single-line declarations.
- MultiLineFunctionDeclarationSniff::processSingleLineDeclaration in vendor/
squizlabs/ php_codesniffer/ src/ Standards/ Squiz/ Sniffs/ Functions/ MultiLineFunctionDeclarationSniff.php - Processes single-line declarations.
1 method overrides FunctionDeclarationSniff::processSingleLineDeclaration()
- MultiLineFunctionDeclarationSniff::processSingleLineDeclaration in vendor/
squizlabs/ php_codesniffer/ src/ Standards/ Squiz/ Sniffs/ Functions/ MultiLineFunctionDeclarationSniff.php - Processes single-line declarations.
File
-
vendor/
squizlabs/ php_codesniffer/ src/ Standards/ PEAR/ Sniffs/ Functions/ FunctionDeclarationSniff.php, line 261
Class
Namespace
PHP_CodeSniffer\Standards\PEAR\Sniffs\FunctionsCode
public function processSingleLineDeclaration($phpcsFile, $stackPtr, $tokens) {
if ($tokens[$stackPtr]['code'] === T_CLOSURE) {
$sniff = new OpeningFunctionBraceKernighanRitchieSniff();
}
else {
$sniff = new OpeningFunctionBraceBsdAllmanSniff();
}
$sniff->checkClosures = true;
$sniff->process($phpcsFile, $stackPtr);
}