function AttributeHelper::getAttributeTarget
3 calls to AttributeHelper::getAttributeTarget()
- AttributeHelper::isValidAttribute in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Helpers/ AttributeHelper.php - * Attributes have syntax that when defined incorrectly or in older PHP version, they are treated as comments. * An example of incorrect declaration is variables that are not properties.
- DisallowMultipleAttributesPerLineSniff::process in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ Attributes/ DisallowMultipleAttributesPerLineSniff.php - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *
- NewWithParenthesesSniff::process in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ ControlStructures/ NewWithParenthesesSniff.php - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *
File
-
vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Helpers/ AttributeHelper.php, line 134
Class
- AttributeHelper
- @internal
Namespace
SlevomatCodingStandard\HelpersCode
public static function getAttributeTarget(File $phpcsFile, int $attributeOpenerPointer) : ?int {
$attributeTargetPointer = TokenHelper::findNext($phpcsFile, self::ATTRIBUTE_TARGETS, $attributeOpenerPointer);
if ($attributeTargetPointer === null) {
return null;
}
if ($phpcsFile->getTokens()[$attributeTargetPointer]['code'] === T_VARIABLE && !PropertyHelper::isProperty($phpcsFile, $attributeTargetPointer) && !ParameterHelper::isParameter($phpcsFile, $attributeTargetPointer)) {
return null;
}
return $attributeTargetPointer;
}