public function getNamespace($name)
{
if ($this->namespaces === null) {
$msg = 'getNamespace() doesn\'t work before the source was analyzed.';
throw new \RuntimeException($msg);
}
foreach ($this->namespaces as $namespace) {
if ($namespace->getName() === $name) {
return $namespace;
}
}
throw new \OutOfBoundsException(sprintf('Unknown namespace "%s".', $name));
}