\phpDocumentor\Plugin\LegacyNamespaceConverterLegacyNamespaceFilter

Converts elements with underscores into a namespaced version.

This filter will examine the Name of an element and extract namespaces based on underscores in the name. Every underscore is treated as a namespace separator.

Summary

Methods
Properties
Constants
__construct()
filter()
setNamespacePrefix()
No public properties found
No constants found
No protected methods found
$builder
N/A
namespaceFromLegacyNamespace()
classNameFromLegacyNamespace()
$namespacePrefix
N/A

Properties

$namespacePrefix

$namespacePrefix : string

Type

string

Methods

__construct()

__construct(\phpDocumentor\Descriptor\ProjectDescriptorBuilder  $builder) 

Initializes this filter with an instance of the builder to retrieve the latest ProjectDescriptor from.

Parameters

\phpDocumentor\Descriptor\ProjectDescriptorBuilder $builder

filter()

filter(\phpDocumentor\Descriptor\DescriptorAbstract  $value) : \phpDocumentor\Descriptor\DescriptorAbstract|null

Overrides the name and namespace of an element with a separated version of the class name.

If a class is separated by underscores than the last part is set as name and the first parts are set as namespace with the namespace separator instead of an underscore.

Parameters

\phpDocumentor\Descriptor\DescriptorAbstract $value

Returns

\phpDocumentor\Descriptor\DescriptorAbstract|null

setNamespacePrefix()

setNamespacePrefix(string  $prefix) 

Set a prefix for all elements without an namespace

Parameters

string $prefix

namespaceFromLegacyNamespace()

namespaceFromLegacyNamespace(string  $namespace, string  $className) : string

Extracts the namespace from the class name.

Parameters

string $namespace
string $className

Returns

string

classNameFromLegacyNamespace()

classNameFromLegacyNamespace(string  $className) : string

Extracts the class name without prefix from the full class name.

Parameters

string $className

Returns

string