+ throw $this->createError(\sprintf('Class \'%s\' not found', $name), $stmt);
+ }
+ }
+
+ /**
+ * Ensure that a referenced class _or trait_ exists.
+ *
+ * @throws FatalErrorException
+ *
+ * @param string $name
+ * @param Stmt $stmt
+ */
+ protected function ensureClassOrTraitExists($name, $stmt)
+ {
+ if (!$this->classExists($name) && !$this->traitExists($name)) {
+ throw $this->createError(\sprintf('Class \'%s\' not found', $name), $stmt);