1 | <?php |
||
39 | class RepoController extends BaseDevCommand |
||
40 | { |
||
41 | const CONFIG_VAR_USERNAME = 'username'; |
||
42 | |||
43 | const CONFIG_VAR_CLONETYPE = 'cloneType'; |
||
44 | |||
45 | const CONFIG_VAR_CUSTOMCLONES = 'customClones'; |
||
46 | |||
47 | /** |
||
48 | * @var string Default action is actionInit(); |
||
49 | */ |
||
50 | public $defaultAction = 'init'; |
||
51 | |||
52 | /** |
||
53 | * @var array The default repos from luyadev |
||
54 | */ |
||
55 | public $repos = [ |
||
56 | 'luya', |
||
57 | 'luya-module-admin', |
||
58 | 'luya-module-cms', |
||
59 | ]; |
||
60 | |||
61 | public $text = <<<EOT |
||
62 | **CLONE REPOS** |
||
63 | |||
64 | We've detected that you don't have all module repos forked to your account. You can only push changes to the forked repos, all others are **READ ONLY**. |
||
65 | |||
66 | If you want to work on a specific repo, make sure that repo is forked to your Github account. |
||
67 | |||
68 | You can also skip this command, fork the repos and rerun this command again. |
||
69 | |||
70 | **FORK ME** |
||
71 | EOT; |
||
72 | |||
73 | /** |
||
74 | * Initilize the main repos. |
||
75 | * |
||
76 | * @return number |
||
77 | */ |
||
78 | public function actionInit() |
||
150 | |||
151 | /** |
||
152 | * Update all repos to master branch from upstream. |
||
153 | */ |
||
154 | public function actionUpdate() |
||
164 | |||
165 | /** |
||
166 | * Clone a repo into the repos folder. |
||
167 | * |
||
168 | * @param string $repo |
||
169 | * @param string $vendor |
||
170 | */ |
||
171 | public function actionClone($vendor = null, $repo = null) |
||
196 | |||
197 | /** |
||
198 | * Remove a given repo from filesystem. |
||
199 | * |
||
200 | * @param string $repo The repo name like `luya-module-cms` without vendor. |
||
201 | */ |
||
202 | public function actionRemove($repo) |
||
213 | |||
214 | private $_gitWrapper; |
||
215 | |||
216 | /** |
||
217 | * @return \GitWrapper\GitWrapper |
||
218 | */ |
||
219 | protected function getGitWrapper() |
||
228 | |||
229 | /** |
||
230 | * |
||
231 | * @param string $repo |
||
232 | * @param string $isFork |
||
233 | * @param string $exists |
||
234 | * @return array |
||
235 | */ |
||
236 | private function summaryItem($repo, $isFork, $exists) |
||
240 | |||
241 | /** |
||
242 | * |
||
243 | * @param string $repo |
||
244 | * @return string |
||
245 | */ |
||
246 | private function getFilesystemRepoPath($repo) |
||
250 | |||
251 | /** |
||
252 | * |
||
253 | * @param string $username |
||
254 | * @param string $repo |
||
255 | * @return boolean |
||
256 | */ |
||
257 | private function forkExists($username, $repo) |
||
261 | |||
262 | /** |
||
263 | * |
||
264 | * @param string $text |
||
265 | * @param boolean $paragraph |
||
266 | * @return string |
||
267 | */ |
||
268 | private function markdown($text, $paragraph = false) |
||
278 | |||
279 | /** |
||
280 | * Return the url to clone based on config clone type (ssh/https). |
||
281 | * |
||
282 | * @param string $repo |
||
283 | * @param string $username |
||
284 | * @return string |
||
285 | */ |
||
286 | private function getCloneUrlBasedOnType($repo, $username) |
||
290 | |||
291 | /** |
||
292 | * Rebase existing repo. |
||
293 | * |
||
294 | * @param string $repo |
||
295 | * @param string $repoFileSystemPath |
||
296 | */ |
||
297 | private function rebaseRepo($repo, $repoFileSystemPath) |
||
310 | |||
311 | /** |
||
312 | * Clone a repo into the repos folder. |
||
313 | * |
||
314 | * @param string $repo |
||
315 | * @param string $cloneUrl |
||
316 | * @param string $newRepoHome |
||
317 | * @param string $upstreamUsername The upstream vendor name of the repo if available. |
||
318 | */ |
||
319 | private function cloneRepo($repo, $cloneUrl, $newRepoHome, $upstreamUsername) |
||
331 | } |
||
332 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: