Completed
Push — develop ( 722f70...af048b )
by Jaap
15:12 queued 05:04
created

Router/UrlGenerator/Standard/ClassDescriptor.php (1 issue)

Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * phpDocumentor
4
 *
5
 * PHP Version 5.4
6
 *
7
 * @copyright 2010-2014 Mike van Riel / Naenius (http://www.naenius.com)
8
 * @license   http://www.opensource.org/licenses/mit-license.php MIT
9
 * @link      http://phpdoc.org
10
 */
11
12
namespace phpDocumentor\Application\Renderer\Router\UrlGenerator\Standard;
13
14
use phpDocumentor\Descriptor;
15
use phpDocumentor\DomainModel\Renderer\Router\UrlGenerator\UrlGeneratorInterface;
16
17
class ClassDescriptor implements UrlGeneratorInterface
18
{
19
    /**
20
     * Generates a URL from the given node or returns false if unable.
21
     *
22
     * @param string|Descriptor\ClassDescriptor $node
23
     *
24
     * @return string|false
25
     */
26
    public function __invoke($node)
27
    {
28
        $converter = new QualifiedNameToUrlConverter();
29
30
        return ($node instanceof Descriptor\DescriptorAbstract)
0 ignored issues
show
The class phpDocumentor\Descriptor\DescriptorAbstract does not exist. Did you forget a USE statement, or did you not list all dependencies?

This error could be the result of:

1. Missing dependencies

PHP Analyzer uses your composer.json file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects the composer.json to be in the root folder of your repository.

Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the require or require-dev section?

2. Missing use statement

PHP does not complain about undefined classes in ìnstanceof checks. For example, the following PHP code will work perfectly fine:

if ($x instanceof DoesNotExist) {
    // Do something.
}

If you have not tested against this specific condition, such errors might go unnoticed.

Loading history...
31
            ? '/classes/' . $converter->fromClass($node->getFullyQualifiedStructuralElementName()) .'.html'
32
            : false;
33
    }
34
}
35