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

Breadcrumb

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

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

RequireConstructorPropertyPromotionSniff

Namespace

SlevomatCodingStandard\Sniffs\Classes

Code

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

API Navigation

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