The ReflectionFileNamespace class reports an information about a namespace in the single file. This class is not available in the standard PHP
class ReflectionFileNamespace
{
public function __construct($fileName, $namespaceName, Namespace_ $namespaceNode = null) {}
public function getClass($className) {}
public function getClasses() {}
public function getConstant($constantName) {}
public function getConstants() {}
public function getDocComment() {}
public function getEndLine() {}
public function getFileName() {}
public function getFunction($functionName) {}
public function getFunctions() {}
public function getName() {}
public function getNamespaceAliases() {}
public function getStartLine() {}
public function hasClass($className) {}
public function hasConstant($constantName) {}
public function hasFunction($functionName) {}
}-
ReflectionFileNamespace::__construct($fileName, $namespaceName, Namespace_ $namespaceNode = null)Constructs an instance of
ReflectionFileNamespaceobject for givenfileNameandnamespaceName. Can accept customNamespace_node as optional parameter. -
ReflectionFileNamespace::getClass($className)Returns the concrete
ReflectionClassfrom the file namespace orfalseif there is no such a class in the current namespace -
ReflectionFileNamespace::getClasses()Returns an array with available classes in the namespace. Each class/trait/interface definition will be represented as a single instance of
ReflectionClassin this list. -
ReflectionFileNamespace::getConstant($constantName)Returns a value for the constant with name
$constantNamein the file namespace orfalseif there is no such a constant in the current namespace. -
ReflectionFileNamespace::getConstants()Returns an array with all available constants in the namespace.
-
ReflectionFileNamespace::getDocComment()Returns a doc-block section for file namespace if present, otherwise
false -
ReflectionFileNamespace::getEndLine()Returns a end line for the namespace. Be careful, this value is not correct for simple
namespace Name;definitions. -
ReflectionFileNamespace::getFileName()Returns a string with the name of file
-
ReflectionFileNamespace::getFunction($functionName)Returns the concrete
ReflectionFunctionfrom the file namespace orfalseif there is no such a function in the current namespace -
ReflectionFileNamespace::getFunctions()Returns an array with available functions in the namespace. Each function definition will be represented as a single instance of
ReflectionFunctionin this list. -
ReflectionFile::getName()Returns a string with the name of current file namespace
-
ReflectionFileNamespace::getNamespaceAliases()Returns an array with all imported class namespaces and aliases for them in the current namespace.
-
ReflectionFileNamespace::getStartLine()Returns a start line for the namespace.
-
ReflectionFileNamespace::hasClass($className)Checks if the requested class is present in the file namespace or not. Returns
trueif present. -
ReflectionFileNamespace::hasConstant($constantName)Checks if the requested constant is present in the file namespace or not. Returns
trueif present. -
ReflectionFileNamespace::hasFunction($functionName)Checks if the requested function is present in the file namespace or not. Returns
trueif present.