function AnnotationException::enumeratorError

Creates a new AnnotationException describing a invalid enumerator.

@phpstan-param list<string> $available

Parameters

mixed $given:

Return value

AnnotationException

1 call to AnnotationException::enumeratorError()
DocParser::Annotation in core/lib/Drupal/Component/Annotation/Doctrine/DocParser.php
Annotation ::= "@" AnnotationName MethodCall AnnotationName ::= QualifiedName | SimpleName QualifiedName ::= NameSpacePart "\" {NameSpacePart "\"}* SimpleName NameSpacePart ::= identifier | null | false |…

File

core/lib/Drupal/Component/Annotation/Doctrine/AnnotationException.php, line 150

Class

AnnotationException
Description of AnnotationException

Namespace

Drupal\Component\Annotation\Doctrine

Code

public static function enumeratorError(string $attributeName, string $annotationName, string $context, array $available, $given) {
  return new self(sprintf('[Enum Error] Attribute "%s" of @%s declared on %s accepts only [%s], but got %s.', $attributeName, $annotationName, $context, implode(', ', $available), is_object($given) ? get_class($given) : $given));
}

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