@@ -157,11 +157,11 @@ discard block |
||
157 | 157 | public function actionUpdate() |
158 | 158 | { |
159 | 159 | foreach ($this->repos as $repo) { |
160 | - $this->rebaseRepo($repo, $this->getFilesystemRepoPath($repo)); |
|
160 | + $this->rebaseRepo($repo, $this->getFilesystemRepoPath($repo)); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | foreach ($this->getConfig(self::CONFIG_VAR_CUSTOMCLONES, []) as $repo => $path) { |
164 | - $this->rebaseRepo($repo, $path); |
|
164 | + $this->rebaseRepo($repo, $path); |
|
165 | 165 | } |
166 | 166 | } |
167 | 167 | |
@@ -173,17 +173,17 @@ discard block |
||
173 | 173 | */ |
174 | 174 | public function actionClone($vendor = null, $repo = null) |
175 | 175 | { |
176 | - // if `vendor/repo` notation is provided |
|
177 | - if ($vendor !== null && strpos($vendor, '/')) { |
|
178 | - list($vendor, $repo) = explode("/", $vendor); |
|
179 | - } |
|
176 | + // if `vendor/repo` notation is provided |
|
177 | + if ($vendor !== null && strpos($vendor, '/')) { |
|
178 | + list($vendor, $repo) = explode("/", $vendor); |
|
179 | + } |
|
180 | 180 | |
181 | 181 | if (empty($vendor)) { |
182 | 182 | $vendor = $this->prompt("Enter the username/vendor for this repo (e.g. luyadev)"); |
183 | 183 | } |
184 | 184 | |
185 | 185 | if (empty($repo)) { |
186 | - $repo = $this->prompt("Enter the name of the repo you like to clone (e.g. luya-module-news)"); |
|
186 | + $repo = $this->prompt("Enter the name of the repo you like to clone (e.g. luya-module-news)"); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | $clones = $this->getConfig(self::CONFIG_VAR_CUSTOMCLONES, []); |
@@ -229,14 +229,14 @@ discard block |
||
229 | 229 | */ |
230 | 230 | public function actionRemove($repo) |
231 | 231 | { |
232 | - FileHelper::removeDirectory($this->getFilesystemRepoPath($repo)); |
|
233 | - $clones = $this->getConfig(self::CONFIG_VAR_CUSTOMCLONES, []); |
|
234 | - if (isset($clones[$repo])) { |
|
235 | - unset($clones[$repo]); |
|
236 | - $this->saveConfig(self::CONFIG_VAR_CUSTOMCLONES, $clones); |
|
237 | - } |
|
232 | + FileHelper::removeDirectory($this->getFilesystemRepoPath($repo)); |
|
233 | + $clones = $this->getConfig(self::CONFIG_VAR_CUSTOMCLONES, []); |
|
234 | + if (isset($clones[$repo])) { |
|
235 | + unset($clones[$repo]); |
|
236 | + $this->saveConfig(self::CONFIG_VAR_CUSTOMCLONES, $clones); |
|
237 | + } |
|
238 | 238 | |
239 | - return $this->outputSuccess("Removed repo {$repo}."); |
|
239 | + return $this->outputSuccess("Removed repo {$repo}."); |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | /** |
@@ -333,16 +333,16 @@ discard block |
||
333 | 333 | */ |
334 | 334 | private function rebaseRepo($repo, $repoFileSystemPath) |
335 | 335 | { |
336 | - $wrapper = new GitWrapper(); |
|
336 | + $wrapper = new GitWrapper(); |
|
337 | 337 | |
338 | - $wrapper->git('checkout master', $repoFileSystemPath); |
|
339 | - $this->outputInfo("{$repo}: checkout master ✔"); |
|
338 | + $wrapper->git('checkout master', $repoFileSystemPath); |
|
339 | + $this->outputInfo("{$repo}: checkout master ✔"); |
|
340 | 340 | |
341 | - $wrapper->git('fetch upstream', $repoFileSystemPath); |
|
342 | - $this->outputInfo("{$repo}: fetch upstream ✔"); |
|
341 | + $wrapper->git('fetch upstream', $repoFileSystemPath); |
|
342 | + $this->outputInfo("{$repo}: fetch upstream ✔"); |
|
343 | 343 | |
344 | - $wrapper->git('rebase upstream/master master', $repoFileSystemPath); |
|
345 | - $this->outputInfo("{$repo}: rebase master ✔"); |
|
344 | + $wrapper->git('rebase upstream/master master', $repoFileSystemPath); |
|
345 | + $this->outputInfo("{$repo}: rebase master ✔"); |
|
346 | 346 | } |
347 | 347 | |
348 | 348 | /** |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | // generate summary overview |
101 | 101 | foreach ($this->repos as $repo) { |
102 | 102 | $newRepoHome = $this->getFilesystemRepoPath($repo); |
103 | - if (file_exists($newRepoHome . DIRECTORY_SEPARATOR . '.git')) { |
|
103 | + if (file_exists($newRepoHome.DIRECTORY_SEPARATOR.'.git')) { |
|
104 | 104 | $summary[] = $this->summaryItem($repo, false, true); |
105 | 105 | } elseif ($this->forkExists($username, $repo)) { |
106 | 106 | $summary[] = $this->summaryItem($repo, true, false); |
@@ -196,13 +196,13 @@ discard block |
||
196 | 196 | |
197 | 197 | $this->saveConfig(self::CONFIG_VAR_CUSTOMCLONES, $clones); |
198 | 198 | |
199 | - $composerReader = new ComposerReader($repoFileSystemPath . DIRECTORY_SEPARATOR . 'composer.json'); |
|
199 | + $composerReader = new ComposerReader($repoFileSystemPath.DIRECTORY_SEPARATOR.'composer.json'); |
|
200 | 200 | |
201 | 201 | if ($composerReader->canRead()) { |
202 | 202 | $section = new AutoloadSection($composerReader); |
203 | 203 | $autoloaders = []; |
204 | 204 | foreach ($section as $autoload) { |
205 | - $newSrc = $repoFileSystemPath . DIRECTORY_SEPARATOR . $autoload->source; |
|
205 | + $newSrc = $repoFileSystemPath.DIRECTORY_SEPARATOR.$autoload->source; |
|
206 | 206 | $autoloaders[] = ['autoload' => $autoload, 'src' => $newSrc]; |
207 | 207 | } |
208 | 208 | |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | */ |
246 | 246 | protected function getProjectComposerReader() |
247 | 247 | { |
248 | - return new ComposerReader(getcwd() . DIRECTORY_SEPARATOR . 'composer.json'); |
|
248 | + return new ComposerReader(getcwd().DIRECTORY_SEPARATOR.'composer.json'); |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | private $_gitWrapper; |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | */ |
283 | 283 | private function getFilesystemRepoPath($repo) |
284 | 284 | { |
285 | - return 'repos' . DIRECTORY_SEPARATOR . $repo; |
|
285 | + return 'repos'.DIRECTORY_SEPARATOR.$repo; |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | /** |