LegacyNamespaceFilter

Extends \Zend\Filter\AbstractFilter

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.

author

david0 https://github.com/david0 this plugin was generously provided by @david0.

link

https://github.com/phpDocumentor/phpDocumentor2/pull/1135

package

Default

Methods

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

__construct(\phpDocumentor\Descriptor\ProjectDescriptorBuilder $builder) 

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

classNameFromLegacyNamespace(string $className) : string

Arguments

$className

string

Response

string

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

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

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.

Arguments

Response

\phpDocumentor\Descriptor\DescriptorAbstract|null

Extracts the namespace from the class name.

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

Arguments

$namespace

string

$className

string

Response

string

Set a prefix for all elements without an namespace

setNamespacePrefix(string $prefix) 

Arguments

$prefix

string

Properties

builder

builder : \phpDocumentor\Descriptor\ProjectDescriptorBuilder

namespacePrefix

namespacePrefix : string
var

Type(s)

string