public function countNamespaces()
{
if ($this->namespaces === null) {
$msg = 'countNamespaces() doesn\'t work before the source was analyzed.';
throw new \RuntimeException($msg);
}
$count = 0;
foreach ($this->namespaces as $namespace) {
if ($namespace->isUserDefined()) {
++$count;
}
}
return $count;
}