public static function AnnotationException::typeError

Creates a new AnnotationException describing an type error of an attribute.

@since 2.2

Parameters

string $attributeName:

string $annotationName:

string $context:

string $expected:

mixed $actual:

Return value

AnnotationException

1 call to AnnotationException::typeError()
DocParser::Annotation in drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Annotations/DocParser.php
Annotation ::= "@" AnnotationName ["(" [Values] ")"] AnnotationName ::= QualifiedName | SimpleName QualifiedName ::= NameSpacePart "\" {NameSpacePart "\"}* SimpleName NameSpacePart ::= identifier…

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationException.php, line 95

Class

AnnotationException
Description of AnnotationException

Namespace

Doctrine\Common\Annotations

Code

public static function typeError($attributeName, $annotationName, $context, $expected, $actual) {
  return new self(sprintf('[Type Error] Attribute "%s" of @%s declared on %s expects %s, but got %s.', $attributeName, $annotationName, $context, $expected, is_object($actual) ? 'an instance of ' . get_class($actual) : gettype($actual)));
}