function DocCommentHelper::findDocCommentOpenPointer
21 calls to DocCommentHelper::findDocCommentOpenPointer()
- AnnotationHelper::getAnnotations in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Helpers/ AnnotationHelper.php - *
- ClassStructureSniff::findGroupStartPointer in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ Classes/ ClassStructureSniff.php - DisallowMultiConstantDefinitionSniff::process in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ Classes/ DisallowMultiConstantDefinitionSniff.php - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *
- DisallowMultiPropertyDefinitionSniff::process in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ Classes/ DisallowMultiPropertyDefinitionSniff.php - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *
- DisallowOneLinePropertyDocCommentSniff::process in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ Commenting/ DisallowOneLinePropertyDocCommentSniff.php - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *
File
-
vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Helpers/ DocCommentHelper.php, line 151
Class
- DocCommentHelper
- @internal
Namespace
SlevomatCodingStandard\HelpersCode
public static function findDocCommentOpenPointer(File $phpcsFile, int $pointer) : ?int {
return SniffLocalCache::getAndSetIfNotCached($phpcsFile, sprintf('doc-comment-open-pointer-%d', $pointer), static function () use ($phpcsFile, $pointer) : ?int {
$tokens = $phpcsFile->getTokens();
if ($tokens[$pointer]['code'] === T_DOC_COMMENT_OPEN_TAG) {
return $pointer;
}
$found = TokenHelper::findPrevious($phpcsFile, [
T_DOC_COMMENT_CLOSE_TAG,
T_SEMICOLON,
T_CLOSE_CURLY_BRACKET,
T_OPEN_CURLY_BRACKET,
], $pointer - 1);
if ($found !== null && $tokens[$found]['code'] === T_DOC_COMMENT_CLOSE_TAG) {
return $tokens[$found]['comment_opener'];
}
return null;
});
}