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.3 |
||
6 | * |
||
7 | * @copyright 2010-2018 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\Transformer\Router; |
||
13 | |||
14 | /** |
||
15 | * Connects class, interface and traits to remote documentation sets. |
||
16 | */ |
||
17 | class ExternalRouter extends RouterAbstract |
||
18 | { |
||
19 | // /** |
||
20 | // * Registers the application configuration with this router. |
||
21 | // * |
||
22 | // * The configuration is used to extract which external routes to add to the application. |
||
23 | // */ |
||
24 | // public function __construct(Configuration $configuration) |
||
25 | // { |
||
26 | // $this->configuration = $configuration; |
||
27 | // |
||
28 | // parent::__construct(); |
||
29 | // } |
||
30 | |||
31 | /** |
||
32 | * Configuration function to add routing rules to a router. |
||
33 | */ |
||
34 | public function configure() |
||
35 | { |
||
36 | $docs = []; //$this->configuration->getTransformer()->getExternalClassDocumentation(); |
||
0 ignored issues
–
show
|
|||
37 | foreach ($docs as $external) { |
||
38 | $prefix = (string) $external->getPrefix(); |
||
39 | $uri = (string) $external->getUri(); |
||
40 | |||
41 | $this[] = new Rule( |
||
42 | function ($node) use ($prefix) { |
||
43 | return is_string($node) && (strpos(ltrim($node, '\\'), $prefix) === 0); |
||
44 | }, |
||
45 | function ($node) use ($uri) { |
||
46 | return str_replace('{CLASS}', ltrim($node, '\\'), $uri); |
||
47 | } |
||
48 | ); |
||
49 | } |
||
50 | } |
||
51 | } |
||
52 |
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.