1 | <?php |
||
18 | class Updater |
||
19 | { |
||
20 | const STRATEGY_GITHUB_API = 1; |
||
21 | |||
22 | /** |
||
23 | * @var int |
||
24 | */ |
||
25 | private $defaultStrategy = self::STRATEGY_GITHUB_API; |
||
26 | |||
27 | /** |
||
28 | * @var StrategyInterface |
||
29 | */ |
||
30 | private $strategy; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | private $pharFile = ''; |
||
36 | |||
37 | /** |
||
38 | * @var string |
||
39 | */ |
||
40 | private $homeDir = ''; |
||
41 | |||
42 | /** |
||
43 | * @param string $pharFile |
||
44 | * @param string $homeDir |
||
45 | */ |
||
46 | public function __construct($pharFile, $homeDir) |
||
58 | |||
59 | /** |
||
60 | * @param StrategyInterface $strategy |
||
61 | */ |
||
62 | public function setStrategy(StrategyInterface $strategy) |
||
66 | |||
67 | /** |
||
68 | * return StrategyInterface |
||
69 | */ |
||
70 | public function getStrategy() |
||
96 | |||
97 | /** |
||
98 | * @return string |
||
99 | * @throws StrategyException |
||
100 | */ |
||
101 | public function getLatestReleaseVersion() |
||
105 | |||
106 | /** |
||
107 | * @param $localVersion |
||
108 | * @return bool |
||
109 | */ |
||
110 | public function hasToUpdate($localVersion) |
||
114 | |||
115 | /** |
||
116 | * @throws StrategyException |
||
117 | */ |
||
118 | public function downloadLatestVersion() |
||
124 | |||
125 | /** |
||
126 | * |
||
127 | */ |
||
128 | public function updateToLatestVersion() |
||
136 | } |
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.