1 | <?php |
||
20 | class CheckComposerUpdatesTask extends BuildTask |
||
|
|||
21 | { |
||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $title = 'Composer update checker'; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $description = 'Checks if any composer dependencies can be updated.'; |
||
31 | |||
32 | private static $dependencies = [ |
||
33 | 'ComposerLoader' => '%$BringYourOwnIdeas\\Maintenance\\Util\\ComposerLoader', |
||
34 | 'UpdateChecker' => '%$BringYourOwnIdeas\\UpdateChecker\\UpdateChecker', |
||
35 | ]; |
||
36 | |||
37 | /** |
||
38 | * @var ComposerLoader |
||
39 | */ |
||
40 | protected $composerLoader; |
||
41 | |||
42 | /** |
||
43 | * @var UpdateChecker |
||
44 | */ |
||
45 | protected $updateChecker; |
||
46 | |||
47 | /** |
||
48 | * Runs the actual steps to verify if there are updates available |
||
49 | * |
||
50 | * @param SS_HTTPRequest $request |
||
51 | */ |
||
52 | public function run($request) |
||
66 | |||
67 | /** |
||
68 | * Retrieve an array of primary composer dependencies from composer.json. |
||
69 | * |
||
70 | * Packages are filtered by allowed type. |
||
71 | * |
||
72 | * @return array[] |
||
73 | */ |
||
74 | protected function getPackages() |
||
101 | |||
102 | /** |
||
103 | * Find all dependency constraints for the given package in the current repository and return the strictest one |
||
104 | * |
||
105 | * @param BaseRepository $repository |
||
106 | * @param string $packageName |
||
107 | * @return string |
||
108 | */ |
||
109 | protected function getInstalledConstraint(BaseRepository $repository, $packageName) |
||
122 | |||
123 | /** |
||
124 | * Check whether the package type is "allowed", which will include it in reports. If the type is not allowed |
||
125 | * then the package will be skipped. |
||
126 | * |
||
127 | * @param string $type |
||
128 | * @return bool |
||
129 | */ |
||
130 | protected function isAllowedType($type) |
||
136 | |||
137 | /** |
||
138 | * prints a message during the run of the task |
||
139 | * |
||
140 | * @param string $text |
||
141 | */ |
||
142 | protected function message($text) |
||
150 | |||
151 | /** |
||
152 | * @param ComposerLoader $composerLoader |
||
153 | * @return $this |
||
154 | */ |
||
155 | public function setComposerLoader(ComposerLoader $composerLoader) |
||
160 | |||
161 | /** |
||
162 | * @return ComposerLoader |
||
163 | */ |
||
164 | public function getComposerLoader() |
||
168 | |||
169 | /** |
||
170 | * @param UpdateChecker $updateChecker |
||
171 | * @return $this |
||
172 | */ |
||
173 | public function setUpdateChecker(UpdateChecker $updateChecker) |
||
178 | |||
179 | /** |
||
180 | * @return UpdateChecker |
||
181 | */ |
||
182 | public function getUpdateChecker() |
||
186 | } |
||
187 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.