You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

38 lines
1.0 KiB

<?php
/**
* phpDocumentor
*
* PHP Version 5.3
*
* @copyright 2010-2013 Mike van Riel / Naenius (http://www.naenius.com)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link https://phpdoc.org
*/
namespace autodoc\Plugin\Core\Transformer\Router\UrlGenerator\Zora;
use phpDocumentor\Descriptor\DescriptorAbstract;
use phpDocumentor\Transformer\Router\UrlGenerator\UrlGeneratorInterface;
class PackageDescriptor implements UrlGeneratorInterface
{
/**
* Generates a URL from the given node or returns false if unable.
*
* @param DescriptorAbstract $node
*
* @return string|false
*/
public function __invoke($node)
{
$name = str_replace('\\', '/', ltrim($node->getFullyQualifiedStructuralElementName(), '\\'));
// convert root namespace to default; default is a keyword and no namespace CAN be named as such
if ($name === '') {
$name = 'default';
}
return '/packages/' . strtolower($name) .'.html';
}
}