Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AttributeHelper.php

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\Helpers

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal