BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
phpDocumentor\Reflection\Types\Context Class Reference

Public Member Functions

 __construct ($namespace, array $namespaceAliases=[])
 getNamespace ()
 getNamespaceAliases ()

Detailed Description

Provides information about the Context in which the DocBlock occurs that receives this context.

A DocBlock does not know of its own accord in which namespace it occurs and which namespace aliases are applicable for the block of code in which it is in. This information is however necessary to resolve Class names in tags since you can provide a short form or make use of namespace aliases.

The phpDocumentor Reflection component knows how to create this class but if you use the DocBlock parser from your own application it is possible to generate a Context class using the ContextFactory; this will analyze the file in which an associated class resides for its namespace and imports.

See Also

Constructor & Destructor Documentation

phpDocumentor\Reflection\Types\Context::__construct (   $namespace,
array  $namespaceAliases = [] 

Initializes the new context and normalizes all passed namespaces to be in Qualified Namespace Name (QNN) format (without a preceding \).

string$namespaceThe namespace where this DocBlock resides in.
array$namespaceAliasesList of namespace aliases => Fully Qualified Namespace.

Member Function Documentation

phpDocumentor\Reflection\Types\Context::getNamespace ( )

Returns the Qualified Namespace Name (thus without \ in front) where the associated element is in.

phpDocumentor\Reflection\Types\Context::getNamespaceAliases ( )

Returns a list of Qualified Namespace Names (thus without \ in front) that are imported, the keys represent the alias for the imported Namespace.


The documentation for this class was generated from the following file: