function RequireConstructorPropertyPromotionSniff::isPropertyWithAttribute
1 call to RequireConstructorPropertyPromotionSniff::isPropertyWithAttribute()
- RequireConstructorPropertyPromotionSniff::process in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ Classes/ RequireConstructorPropertyPromotionSniff.php - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *
File
-
vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ Classes/ RequireConstructorPropertyPromotionSniff.php, line 336
Class
Namespace
SlevomatCodingStandard\Sniffs\ClassesCode
private function isPropertyWithAttribute(File $phpcsFile, int $propertyPointer) : bool {
$tokens = $phpcsFile->getTokens();
$previousPointer = TokenHelper::findPrevious($phpcsFile, [
T_ATTRIBUTE_END,
T_SEMICOLON,
T_OPEN_CURLY_BRACKET,
T_CLOSE_CURLY_BRACKET,
], $propertyPointer - 1);
return $tokens[$previousPointer]['code'] === T_ATTRIBUTE_END;
}