1 | <?php |
||
19 | abstract class Base implements Command |
||
20 | { |
||
21 | /** |
||
22 | * Repository root directory |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $repositoryRoot; |
||
27 | |||
28 | /** |
||
29 | * Base constructor. |
||
30 | * |
||
31 | * @param string $root |
||
32 | */ |
||
33 | 19 | public function __construct(string $root = '') |
|
37 | |||
38 | /** |
||
39 | * Return cli command to execute. |
||
40 | * |
||
41 | * @return string |
||
42 | */ |
||
43 | 13 | public function getCommand() : string |
|
56 | |||
57 | /** |
||
58 | * Do we need the -C option. |
||
59 | * |
||
60 | * @return string |
||
61 | */ |
||
62 | 13 | protected function getRootOption() : string |
|
75 | |||
76 | /** |
||
77 | * Auto cast method. |
||
78 | * |
||
79 | * @return string |
||
80 | */ |
||
81 | 4 | public function __toString() : string |
|
85 | |||
86 | /** |
||
87 | * Return the command to execute. |
||
88 | * |
||
89 | * @return string |
||
90 | * @throws \RuntimeException |
||
91 | */ |
||
92 | protected abstract function getGitCommand() : string; |
||
93 | } |
||
94 |
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.