Completed
Push — develop ( 8eb671...133594 )
by Mike
19:30 queued 09:24
created

Transformer/Router/ExternalRouter.php (1 issue)

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
declare(strict_types=1);
3
4
/**
5
 * This file is part of phpDocumentor.
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @author    Mike van Riel <[email protected]>
11
 * @copyright 2010-2018 Mike van Riel / Naenius (http://www.naenius.com)
12
 * @license   http://www.opensource.org/licenses/mit-license.php MIT
13
 * @link      http://phpdoc.org
14
 */
15
16
namespace phpDocumentor\Transformer\Router;
17
18
/**
19
 * Connects class, interface and traits to remote documentation sets.
20
 */
21
class ExternalRouter extends RouterAbstract
22
{
23
//    /**
24
//     * Registers the application configuration with this router.
25
//     *
26
//     * The configuration is used to extract which external routes to add to the application.
27
//     */
28
//    public function __construct(Configuration $configuration)
29
//    {
30
//        $this->configuration = $configuration;
31
//
32
//        parent::__construct();
33
//    }
34
35
    /**
36
     * Configuration function to add routing rules to a router.
37
     */
38
    public function configure()
39
    {
40
        $docs = []; //$this->configuration->getTransformer()->getExternalClassDocumentation();
0 ignored issues
show
Unused Code Comprehensibility introduced by
75% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
41
        foreach ($docs as $external) {
42
            $prefix = (string) $external->getPrefix();
43
            $uri = (string) $external->getUri();
44
45
            $this[] = new Rule(
46
                function ($node) use ($prefix) {
47
                    return is_string($node) && (strpos(ltrim($node, '\\'), $prefix) === 0);
48
                },
49
                function ($node) use ($uri) {
50
                    return str_replace('{CLASS}', ltrim($node, '\\'), $uri);
51
                }
52
            );
53
        }
54
    }
55
}
56