namespaces[$alias] = rtrim($namespace, '\\'); return $this; } /** * Get namespace by his alias. * * @param string $label * * @throws \Exception * * @return string */ public function getNamespace($alias) { if (!isset($this->namespaces[$alias])) { throw new NamespaceNotFoundException('Namespace not found with the alias "'.$alias.'"'); } return $this->namespaces[$alias]; } }