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

Breadcrumb

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

function DocParser::instantiateAnnotiation

Try to instantiate the annotation and catch and process any exceptions related to failure

Parameters

class-string $name:

array<string,mixed> $arguments:

Return value

object

Throws

AnnotationException

1 call to DocParser::instantiateAnnotiation()
DocParser::Annotation in vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php
Annotation ::= "@" AnnotationName MethodCall AnnotationName ::= QualifiedName | SimpleName QualifiedName ::= NameSpacePart "\" {NameSpacePart "\"}* SimpleName NameSpacePart ::= identifier | null | false |…

File

vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php, line 1480

Class

DocParser
A parser for docblock annotations.

Namespace

Doctrine\Common\Annotations

Code

private function instantiateAnnotiation(string $originalName, string $context, string $name, array $arguments) {
    try {
        return new $name(...$arguments);
    } catch (Throwable $exception) {
        throw AnnotationException::creationError(sprintf('An error occurred while instantiating the annotation @%s declared on %s: "%s".', $originalName, $context, $exception->getMessage()), $exception);
    }
}
RSS feed
Powered by Drupal