-
Notifications
You must be signed in to change notification settings - Fork 43
5. Plugins
Just implement PhpDA\Parser\Filter\NamespaceFilterInterface
to your filter class to modify the namespace of collected dependencies.
After that you can set it in the configuration.
How to add plugins to composer autoloader?
Just implement PhpDA\Reference\ValidatorInterface
to your reference validator class to verify each dependency.
After that you can set it in the configuration. See here for instance.
How to add plugins to composer autoloader?
Visitors are provided by Visitor-Pattern implemented by Nikic's Php-Parser.
Read the docs to get into the idea of visitor.
To get your own visitor, just create a new one by extending
PhpDA\Parser\Visitor\AbstractVisitor.
Beside this you have to implement one of the following Interfaces to declare the concern by contract:
PhpDA\Parser\Visitor\Feature\UsedNamespaceCollectorInterfacePhpDA\Parser\Visitor\Feature\UnsupportedNamespaceCollectorInterfacePhpDA\Parser\Visitor\Feature\NamespacedStringCollectorInterface
After that you can add it to the configuration.
How to add plugins to composer autoloader?
To get your own Formatter to create other reports, just implement PhpDA\Writer\Strategy\StrategyInterface
to a new one.
After that you can set it in the configuration.
How to add plugins to composer autoloader?
Adding classes to the composer autoloader mapping is well defined here.
For instance your plugin has the FQCN MyPhpDA\MyPlugin and is located in path/to/src/MyPhpDA/MyPlugin.php.
In this case you have to add the reference in your composer.json:
{
"autoload-dev": {
"psr-0": {
"MyPhpDA\\": "path/to/src/"
}
}
}After that you have to execute a composer update to regenerate the autoloader map:
composer update -o