function StaticReflectionParser::hasClassAttribute

Same name in other branches
  1. 10 core/lib/Drupal/Component/Annotation/Doctrine/StaticReflectionParser.php \Drupal\Component\Annotation\Doctrine\StaticReflectionParser::hasClassAttribute()

Determines if the class has the provided class attribute.

Parameters

string $attribute The fully qualified attribute to check for.:

Return value

bool

File

core/lib/Drupal/Component/Annotation/Doctrine/StaticReflectionParser.php, line 346

Class

StaticReflectionParser
Parses a file for namespaces/use/class declarations.

Namespace

Drupal\Component\Annotation\Doctrine

Code

public function hasClassAttribute(string $attribute) : bool {
    $this->parse();
    foreach ($this->classAttributes as $classAttribute) {
        if (is_a($classAttribute, $attribute, TRUE)) {
            return TRUE;
        }
    }
    return FALSE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.