You are here

public function DocParser::setImports in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Component/Annotation/Doctrine/DocParser.php \Drupal\Component\Annotation\Doctrine\DocParser::setImports()

Sets the imports.

Parameters

array $imports:

Return value

void

Throws

\RuntimeException

File

core/lib/Drupal/Component/Annotation/Doctrine/DocParser.php, line 297
This class is a near-copy of Doctrine\Common\Annotations\DocParser, which is part of the Doctrine project: <http://www.doctrine-project.org>. It was copied from version 1.2.7.

Class

DocParser
A parser for docblock annotations.

Namespace

Drupal\Component\Annotation\Doctrine

Code

public function setImports(array $imports) {
  if ($this->namespaces) {
    throw new \RuntimeException('You must either use addNamespace(), or setImports(), but not both.');
  }
  $this->imports = $imports;
}