1 | <?php |
||
12 | final class Host implements DirectiveInterface, RobotsTxtInterface |
||
13 | { |
||
14 | use UrlToolbox; |
||
15 | |||
16 | /** |
||
17 | * Directive |
||
18 | */ |
||
19 | const DIRECTIVE = self::DIRECTIVE_HOST; |
||
20 | |||
21 | /** |
||
22 | * Host array |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $array = []; |
||
26 | |||
27 | /** |
||
28 | * Host constructor. |
||
29 | */ |
||
30 | public function __construct() |
||
33 | |||
34 | /** |
||
35 | * Add |
||
36 | * |
||
37 | * @param string $line |
||
38 | * @return bool |
||
39 | */ |
||
40 | public function add($line) |
||
65 | |||
66 | /** |
||
67 | * Check |
||
68 | * |
||
69 | * @param string $url |
||
70 | * @return bool |
||
71 | */ |
||
72 | public function check($url) |
||
94 | |||
95 | /** |
||
96 | * Export |
||
97 | * |
||
98 | * @return array |
||
99 | */ |
||
100 | public function export() |
||
104 | |||
105 | public function optimize($url) |
||
112 | } |
||
113 |
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.