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

Breadcrumb

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

function DocCommentHelper::hasInheritdocAnnotation

4 calls to DocCommentHelper::hasInheritdocAnnotation()
ParameterTypeHintSniff::process in vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ParameterTypeHintSniff.php
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *
PropertyTypeHintSniff::process in vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/PropertyTypeHintSniff.php
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *
ReturnTypeHintSniff::process in vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/TypeHints/ReturnTypeHintSniff.php
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *
UselessFunctionDocCommentSniff::process in vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Commenting/UselessFunctionDocCommentSniff.php
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *

File

vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/DocCommentHelper.php, line 119

Class

DocCommentHelper
@internal

Namespace

SlevomatCodingStandard\Helpers

Code

public static function hasInheritdocAnnotation(File $phpcsFile, int $pointer) : bool {
    $docCommentOpenPointer = self::findDocCommentOpenPointer($phpcsFile, $pointer);
    if ($docCommentOpenPointer === null) {
        return false;
    }
    $parsedDocComment = self::parseDocComment($phpcsFile, $docCommentOpenPointer);
    if ($parsedDocComment === null) {
        return false;
    }
    foreach ($parsedDocComment->getNode()->children as $child) {
        if ($child instanceof PhpDocTextNode && stripos($child->text, '{@inheritdoc}') !== false) {
            return true;
        }
        if ($child instanceof PhpDocTagNode && strtolower($child->name) === '@inheritdoc') {
            return true;
        }
    }
    return false;
}
RSS feed
Powered by Drupal