function InlineDocCommentDeclarationSniff::isAssignment
1 call to InlineDocCommentDeclarationSniff::isAssignment()
- InlineDocCommentDeclarationSniff::checkVariable in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ Commenting/ InlineDocCommentDeclarationSniff.php - *
File
-
vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ Commenting/ InlineDocCommentDeclarationSniff.php, line 482
Class
Namespace
SlevomatCodingStandard\Sniffs\CommentingCode
private function isAssignment(File $phpcsFile, int $pointer) : bool {
$tokens = $phpcsFile->getTokens();
$pointerAfterVariable = TokenHelper::findNextEffective($phpcsFile, $pointer + 1);
if ($tokens[$pointerAfterVariable]['code'] === T_SEMICOLON) {
$pointerBeforeVariable = TokenHelper::findPreviousEffective($phpcsFile, $pointer - 1);
return $tokens[$pointerBeforeVariable]['code'] === T_STATIC;
}
return in_array($tokens[$pointerAfterVariable]['code'], [
T_EQUAL,
T_COALESCE_EQUAL,
], true);
}