You are here

public function Context::setNamespace in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Context.php \phpDocumentor\Reflection\DocBlock\Context::setNamespace()

Sets a new namespace.

Sets a new namespace for the context. Leading and trailing slashes are trimmed, and the keywords "global" and "default" are treated as aliases to no namespace.

Parameters

string $namespace The new namespace to set.:

Return value

$this

1 call to Context::setNamespace()
Context::__construct in vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Context.php
Cteates a new context.

File

vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Context.php, line 91

Class

Context
The context in which a DocBlock occurs.

Namespace

phpDocumentor\Reflection\DocBlock

Code

public function setNamespace($namespace) {
  if ('global' !== $namespace && 'default' !== $namespace) {

    // Srip leading and trailing slash
    $this->namespace = trim((string) $namespace, '\\');
  }
  else {
    $this->namespace = '';
  }
  return $this;
}