@@ -15,7 +15,6 @@ |
||
15 | 15 | namespace Netresearch\Kite\Task; |
16 | 16 | |
17 | 17 | |
18 | -use Netresearch\Kite\Exception; |
|
19 | 18 | use Netresearch\Kite\Task; |
20 | 19 | |
21 | 20 | /** |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * See class comment |
|
4 | - * |
|
5 | - * PHP Version 5 |
|
6 | - * |
|
7 | - * @category Netresearch |
|
8 | - * @package Netresearch\Kite |
|
9 | - * @subpackage Task |
|
10 | - * @author Christian Opitz <[email protected]> |
|
11 | - * @license http://www.netresearch.de Netresearch Copyright |
|
12 | - * @link http://www.netresearch.de |
|
13 | - */ |
|
3 | + * See class comment |
|
4 | + * |
|
5 | + * PHP Version 5 |
|
6 | + * |
|
7 | + * @category Netresearch |
|
8 | + * @package Netresearch\Kite |
|
9 | + * @subpackage Task |
|
10 | + * @author Christian Opitz <[email protected]> |
|
11 | + * @license http://www.netresearch.de Netresearch Copyright |
|
12 | + * @link http://www.netresearch.de |
|
13 | + */ |
|
14 | 14 | |
15 | 15 | namespace Netresearch\Kite\Task; |
16 | 16 |
@@ -136,7 +136,7 @@ |
||
136 | 136 | /** |
137 | 137 | * Execute the command |
138 | 138 | * |
139 | - * @return mixed |
|
139 | + * @return null|string |
|
140 | 140 | */ |
141 | 141 | protected function executeCommand() |
142 | 142 | { |
@@ -15,8 +15,6 @@ |
||
15 | 15 | namespace Netresearch\Kite\Task; |
16 | 16 | use Netresearch\Kite\Task; |
17 | 17 | use Netresearch\Kite\Tasks; |
18 | -use Netresearch\Kite\Workflow; |
|
19 | -use Netresearch\Kite\Exception; |
|
20 | 18 | |
21 | 19 | /** |
22 | 20 | * Run tasks or a workflow within a task |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * See class comment |
|
4 | - * |
|
5 | - * PHP Version 5 |
|
6 | - * |
|
7 | - * @category Netresearch |
|
8 | - * @package Netresearch\Kite |
|
9 | - * @subpackage Task |
|
10 | - * @author Christian Opitz <[email protected]> |
|
11 | - * @license http://www.netresearch.de Netresearch Copyright |
|
12 | - * @link http://www.netresearch.de |
|
13 | - */ |
|
3 | + * See class comment |
|
4 | + * |
|
5 | + * PHP Version 5 |
|
6 | + * |
|
7 | + * @category Netresearch |
|
8 | + * @package Netresearch\Kite |
|
9 | + * @subpackage Task |
|
10 | + * @author Christian Opitz <[email protected]> |
|
11 | + * @license http://www.netresearch.de Netresearch Copyright |
|
12 | + * @link http://www.netresearch.de |
|
13 | + */ |
|
14 | 14 | |
15 | 15 | namespace Netresearch\Kite\Task; |
16 | 16 | use Netresearch\Kite\Task; |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | /** |
427 | 427 | * Execute the next fetched task after given $task |
428 | 428 | * |
429 | - * @param Task|string $task Task or task name |
|
429 | + * @param string $task Task or task name |
|
430 | 430 | * |
431 | 431 | * @return $this |
432 | 432 | */ |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | * @param string $question The question |
445 | 445 | * @param string $default The default value |
446 | 446 | * |
447 | - * @return mixed|\Netresearch\Kite\Task |
|
447 | + * @return string |
|
448 | 448 | */ |
449 | 449 | public function answer($question, $default = null) |
450 | 450 | { |
@@ -506,11 +506,11 @@ discard block |
||
506 | 506 | * Run a composer command |
507 | 507 | * |
508 | 508 | * @param string $command The command to execute |
509 | - * @param array|string|null $optArg Options and arguments |
|
509 | + * @param string $optArg Options and arguments |
|
510 | 510 | * {@see \Netresearch\Kite\Task\ShellTask} |
511 | 511 | * @param array $processSettings Settings for symfony process class |
512 | 512 | * |
513 | - * @return string|\Netresearch\Kite\Task\ComposerTask |
|
513 | + * @return string |
|
514 | 514 | */ |
515 | 515 | public function composer($command, $optArg = null, array $processSettings = array()) |
516 | 516 | { |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | * {@see \Netresearch\Kite\Task\ShellTask} |
567 | 567 | * @param array $processSettings Settings for symfony process class |
568 | 568 | * |
569 | - * @return Task\GitTask|string |
|
569 | + * @return string |
|
570 | 570 | */ |
571 | 571 | public function git($command, $cwd = null, $optArg = null, array $processSettings = array()) |
572 | 572 | { |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | /** |
577 | 577 | * Run a workflow for each of the $array's values. |
578 | 578 | * |
579 | - * @param array|\Traversable $array The object to iterate over |
|
579 | + * @param string $array The object to iterate over |
|
580 | 580 | * @param string|array $as Either string for |
581 | 581 | * foreach ($array as $as) |
582 | 582 | * or array for |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | * {@see \Netresearch\Kite\Task\ShellTask} |
634 | 634 | * @param array $processSettings Settings for symfony process class |
635 | 635 | * |
636 | - * @return Task\RemoteShellTask|string |
|
636 | + * @return string |
|
637 | 637 | */ |
638 | 638 | public function remoteShell($command, $cwd = null, $optArg = null, array $processSettings = array()) |
639 | 639 | { |
@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * See class comment |
|
4 | - * |
|
5 | - * PHP Version 5 |
|
6 | - * |
|
7 | - * @category Netresearch |
|
8 | - * @package Netresearch\Kite |
|
9 | - * @author Christian Opitz <[email protected]> |
|
10 | - * @license http://www.netresearch.de Netresearch Copyright |
|
11 | - * @link http://www.netresearch.de |
|
12 | - */ |
|
3 | + * See class comment |
|
4 | + * |
|
5 | + * PHP Version 5 |
|
6 | + * |
|
7 | + * @category Netresearch |
|
8 | + * @package Netresearch\Kite |
|
9 | + * @author Christian Opitz <[email protected]> |
|
10 | + * @license http://www.netresearch.de Netresearch Copyright |
|
11 | + * @link http://www.netresearch.de |
|
12 | + */ |
|
13 | 13 | |
14 | 14 | namespace Netresearch\Kite; |
15 | 15 | use Netresearch\Kite\Exception\BreakException; |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | /** |
144 | 144 | * Get a variable from this very object (unexpanded) |
145 | 145 | * |
146 | - * @param mixed $offset Variable name |
|
146 | + * @param string $offset Variable name |
|
147 | 147 | * |
148 | 148 | * @internal Required set/get/has/remove in order to access entries of Variables |
149 | 149 | * without looking up parents. |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | /** |
175 | 175 | * Set a variable on this very object |
176 | 176 | * |
177 | - * @param mixed $offset Variable name |
|
177 | + * @param string $offset Variable name |
|
178 | 178 | * @param mixed $value The value |
179 | 179 | * |
180 | 180 | * @internal See {@see Variables::offsetGet()} |
@@ -12,8 +12,6 @@ |
||
12 | 12 | */ |
13 | 13 | |
14 | 14 | namespace Netresearch\Kite\Workflow\Composer; |
15 | -use Netresearch\Kite\Exception; |
|
16 | - |
|
17 | 15 | use Netresearch\Kite\Workflow; |
18 | 16 | |
19 | 17 | /** |
@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * See class comment |
|
4 | - * |
|
5 | - * PHP Version 5 |
|
6 | - * |
|
7 | - * @category Netresearch |
|
8 | - * @package Netresearch\Kite\Workflow\Composer |
|
9 | - * @author Christian Opitz <[email protected]> |
|
10 | - * @license http://www.netresearch.de Netresearch Copyright |
|
11 | - * @link http://www.netresearch.de |
|
12 | - */ |
|
3 | + * See class comment |
|
4 | + * |
|
5 | + * PHP Version 5 |
|
6 | + * |
|
7 | + * @category Netresearch |
|
8 | + * @package Netresearch\Kite\Workflow\Composer |
|
9 | + * @author Christian Opitz <[email protected]> |
|
10 | + * @license http://www.netresearch.de Netresearch Copyright |
|
11 | + * @link http://www.netresearch.de |
|
12 | + */ |
|
13 | 13 | |
14 | 14 | namespace Netresearch\Kite\Workflow\Composer; |
15 | 15 | use Netresearch\Kite\Exception; |
@@ -189,25 +189,25 @@ discard block |
||
189 | 189 | ) |
190 | 190 | ); |
191 | 191 | switch ($fix) { |
192 | - case 1: |
|
193 | - $this->git('add', $package->path, array('N' => true, 'A' => true)); |
|
194 | - $this->console->output(''); |
|
195 | - $this->git('diff', $package->path, 'HEAD', array('tty' => true)); |
|
196 | - $this->console->output(''); |
|
197 | - $this->fixUnstagedChanges($package); |
|
198 | - break; |
|
199 | - case 2: |
|
200 | - $this->git('reset', $package->path, array('hard' => true)); |
|
201 | - $this->git('clean', $package->path, array('i' => true, 'd' => true), array('tty' => true)); |
|
202 | - break; |
|
203 | - case 3: |
|
204 | - $this->git('reset', $package->path); |
|
205 | - $args = 'save -u'; |
|
206 | - if ($message = $this->answer('Message for stash:')) { |
|
207 | - $args .= ' ' . escapeshellarg($message); |
|
208 | - } |
|
209 | - $this->git('stash', $package->path, $args); |
|
210 | - break; |
|
192 | + case 1: |
|
193 | + $this->git('add', $package->path, array('N' => true, 'A' => true)); |
|
194 | + $this->console->output(''); |
|
195 | + $this->git('diff', $package->path, 'HEAD', array('tty' => true)); |
|
196 | + $this->console->output(''); |
|
197 | + $this->fixUnstagedChanges($package); |
|
198 | + break; |
|
199 | + case 2: |
|
200 | + $this->git('reset', $package->path, array('hard' => true)); |
|
201 | + $this->git('clean', $package->path, array('i' => true, 'd' => true), array('tty' => true)); |
|
202 | + break; |
|
203 | + case 3: |
|
204 | + $this->git('reset', $package->path); |
|
205 | + $args = 'save -u'; |
|
206 | + if ($message = $this->answer('Message for stash:')) { |
|
207 | + $args .= ' ' . escapeshellarg($message); |
|
208 | + } |
|
209 | + $this->git('stash', $package->path, $args); |
|
210 | + break; |
|
211 | 211 | } |
212 | 212 | } |
213 | 213 | |
@@ -265,24 +265,24 @@ discard block |
||
265 | 265 | $fixes[3] = 'Push with <comment>--force</comment>'; |
266 | 266 | } |
267 | 267 | switch ($this->selectFixes($fixes)) { |
268 | - case 1: |
|
269 | - $this->gitRevDiff($package, '@\{u\}', 'Remote', 'Local'); |
|
270 | - $this->fixRemoteSynchronicity($package); |
|
271 | - break; |
|
272 | - case 3: |
|
273 | - $commands = array('push'); |
|
274 | - $options = '--force'; |
|
275 | - case 2: |
|
276 | - foreach ($commands as $command) { |
|
277 | - $pck = "<comment>{$package->name}</comment>"; |
|
278 | - $this->console->output($msg = ucfirst($command) . "ing $pck...", false); |
|
279 | - $this->git($command, $package->path, isset($options) ? $options : null); |
|
280 | - $this->console->output( |
|
281 | - str_repeat(chr(8), strlen(strip_tags($msg))) |
|
282 | - . "<fg=green>Sucessfully {$command}ed $pck</>" |
|
283 | - ); |
|
284 | - } |
|
285 | - break; |
|
268 | + case 1: |
|
269 | + $this->gitRevDiff($package, '@\{u\}', 'Remote', 'Local'); |
|
270 | + $this->fixRemoteSynchronicity($package); |
|
271 | + break; |
|
272 | + case 3: |
|
273 | + $commands = array('push'); |
|
274 | + $options = '--force'; |
|
275 | + case 2: |
|
276 | + foreach ($commands as $command) { |
|
277 | + $pck = "<comment>{$package->name}</comment>"; |
|
278 | + $this->console->output($msg = ucfirst($command) . "ing $pck...", false); |
|
279 | + $this->git($command, $package->path, isset($options) ? $options : null); |
|
280 | + $this->console->output( |
|
281 | + str_repeat(chr(8), strlen(strip_tags($msg))) |
|
282 | + . "<fg=green>Sucessfully {$command}ed $pck</>" |
|
283 | + ); |
|
284 | + } |
|
285 | + break; |
|
286 | 286 | } |
287 | 287 | } |
288 | 288 | |
@@ -371,19 +371,19 @@ discard block |
||
371 | 371 | } |
372 | 372 | } |
373 | 373 | switch ($this->selectFixes($actions)) { |
374 | - case 1: |
|
375 | - $this->gitRevDiff($package, $package->requiredBranch, $requiredConstraint, $currentConstraint); |
|
376 | - $this->fixRequirementsMatch($package); |
|
377 | - break; |
|
378 | - case 2: |
|
379 | - $this->checkoutPackage($package, $package->requiredBranch); |
|
380 | - $this->reloadRequires($package); |
|
381 | - break; |
|
382 | - case 3: |
|
383 | - foreach ($package->unsatisfiedDependentPackages as $dependentPackage) { |
|
384 | - $this->rewriteRequirement($dependentPackage, $package->name, $currentConstraint); |
|
385 | - } |
|
386 | - break; |
|
374 | + case 1: |
|
375 | + $this->gitRevDiff($package, $package->requiredBranch, $requiredConstraint, $currentConstraint); |
|
376 | + $this->fixRequirementsMatch($package); |
|
377 | + break; |
|
378 | + case 2: |
|
379 | + $this->checkoutPackage($package, $package->requiredBranch); |
|
380 | + $this->reloadRequires($package); |
|
381 | + break; |
|
382 | + case 3: |
|
383 | + foreach ($package->unsatisfiedDependentPackages as $dependentPackage) { |
|
384 | + $this->rewriteRequirement($dependentPackage, $package->name, $currentConstraint); |
|
385 | + } |
|
386 | + break; |
|
387 | 387 | } |
388 | 388 | } |
389 | 389 | |
@@ -438,17 +438,17 @@ discard block |
||
438 | 438 | ); |
439 | 439 | |
440 | 440 | switch ($fix) { |
441 | - case 1: |
|
442 | - $this->gitRevDiff($package, $package->source->reference, 'Locked', 'Current'); |
|
443 | - $this->fixDivergeFromLock($package); |
|
444 | - break; |
|
445 | - case 2: |
|
446 | - $this->composerUpdateRequired = true; |
|
447 | - break; |
|
448 | - case 3: |
|
449 | - $this->git('checkout', $package->path, $package->source->reference); |
|
450 | - $this->reloadRequires($package); |
|
451 | - break; |
|
441 | + case 1: |
|
442 | + $this->gitRevDiff($package, $package->source->reference, 'Locked', 'Current'); |
|
443 | + $this->fixDivergeFromLock($package); |
|
444 | + break; |
|
445 | + case 2: |
|
446 | + $this->composerUpdateRequired = true; |
|
447 | + break; |
|
448 | + case 3: |
|
449 | + $this->git('checkout', $package->path, $package->source->reference); |
|
450 | + $this->reloadRequires($package); |
|
451 | + break; |
|
452 | 452 | } |
453 | 453 | } |
454 | 454 |
@@ -81,7 +81,7 @@ |
||
81 | 81 | public function assemble() |
82 | 82 | { |
83 | 83 | $this->callback( |
84 | - function () { |
|
84 | + function() { |
|
85 | 85 | $fix = $this->get('fix'); |
86 | 86 | $fixes = ($fix === true) ? $this->fixes : (array) $fix; |
87 | 87 | $checks = $this->get('check') ?: $this->checks; |
@@ -14,7 +14,6 @@ |
||
14 | 14 | |
15 | 15 | namespace Netresearch\Kite\Workflow\Composer; |
16 | 16 | use Netresearch\Kite\Service\Composer\Package; |
17 | -use Netresearch\Kite\Task; |
|
18 | 17 | use Netresearch\Kite\Workflow; |
19 | 18 | |
20 | 19 |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * See class comment |
|
4 | - * |
|
5 | - * PHP Version 5 |
|
6 | - * |
|
7 | - * @category Netresearch |
|
8 | - * @package Netresearch\Kite\Workflow |
|
9 | - * @subpackage Composer |
|
10 | - * @author Christian Opitz <[email protected]> |
|
11 | - * @license http://www.netresearch.de Netresearch Copyright |
|
12 | - * @link http://www.netresearch.de |
|
13 | - */ |
|
3 | + * See class comment |
|
4 | + * |
|
5 | + * PHP Version 5 |
|
6 | + * |
|
7 | + * @category Netresearch |
|
8 | + * @package Netresearch\Kite\Workflow |
|
9 | + * @subpackage Composer |
|
10 | + * @author Christian Opitz <[email protected]> |
|
11 | + * @license http://www.netresearch.de Netresearch Copyright |
|
12 | + * @link http://www.netresearch.de |
|
13 | + */ |
|
14 | 14 | |
15 | 15 | namespace Netresearch\Kite\Workflow\Composer; |
16 | 16 | use Netresearch\Kite\Service\Composer\Package; |
@@ -77,7 +77,7 @@ |
||
77 | 77 | public function assemble() |
78 | 78 | { |
79 | 79 | $this->callback( |
80 | - function () { |
|
80 | + function() { |
|
81 | 81 | $mergeBranch = $this->get('branch'); |
82 | 82 | $diagnose = !$this->get('no-diagnose'); |
83 | 83 | $delete = $this->get('delete', false); |
@@ -14,10 +14,7 @@ |
||
14 | 14 | |
15 | 15 | namespace Netresearch\Kite\Workflow; |
16 | 16 | use Netresearch\Kite\Task; |
17 | - |
|
18 | 17 | use Netresearch\Kite\Workflow; |
19 | -use Netresearch\Kite\Exception; |
|
20 | - |
|
21 | 18 | use Symfony\Component\Console\Input\InputOption; |
22 | 19 | |
23 | 20 | /** |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | $sub = $this->iterate('{nodes}', 'node'); |
198 | 198 | $sub->message('<step>Activating ' . ($this->release ? 'new' : 'latest') . ' release</step>'); |
199 | 199 | $sub->callback( |
200 | - function (Task\IterateTask $iterator) { |
|
200 | + function(Task\IterateTask $iterator) { |
|
201 | 201 | $links = $iterator->remoteShell('echo "`readlink previous`;`readlink current`;`readlink next`"', '{node.deployPath}'); |
202 | 202 | list($previous, $current, $next) = explode(';', $links); |
203 | 203 | |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | $sub = $this->iterate('{nodes}', 'node'); |
253 | 253 | $sub->message('<step>Restoring previous release</step>'); |
254 | 254 | $sub->callback( |
255 | - function (Task\IterateTask $iterator) use (&$firstPreviousRelease) { |
|
255 | + function(Task\IterateTask $iterator) use (&$firstPreviousRelease) { |
|
256 | 256 | $links = $iterator->remoteShell('echo "`readlink previous`;`readlink current`;`readlink next`"', '{node.deployPath}'); |
257 | 257 | list($previous, $current, $next) = explode(';', $links); |
258 | 258 | if (!$previous) { |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | $sub = $this->iterate('{shared}', array('type' => 'entries')); |
293 | 293 | $sub->message('<step>Linking shared resources</step>'); |
294 | 294 | $sub->callback( |
295 | - function (Task\IterateTask $iterator) { |
|
295 | + function(Task\IterateTask $iterator) { |
|
296 | 296 | $type = $iterator->get('type'); |
297 | 297 | if (!in_array($type, array('dirs', 'files'), true)) { |
298 | 298 | $iterator->doExit('shared may only contain keys "dirs" or "files"', 1); |
@@ -13,12 +13,9 @@ |
||
13 | 13 | */ |
14 | 14 | |
15 | 15 | namespace Netresearch\Kite\Workflow; |
16 | -use Netresearch\Kite\Service\Factory; |
|
17 | 16 | use Netresearch\Kite\Task; |
18 | - |
|
19 | 17 | use Netresearch\Kite\Workflow; |
20 | 18 | use Netresearch\Kite\Exception; |
21 | - |
|
22 | 19 | use Symfony\Component\Console\Output\OutputInterface; |
23 | 20 | |
24 | 21 | /** |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * See class comment |
|
4 | - * |
|
5 | - * PHP Version 5 |
|
6 | - * |
|
7 | - * @category Netresearch |
|
8 | - * @package Netresearch\Kite |
|
9 | - * @subpackage Workflow |
|
10 | - * @author Christian Opitz <[email protected]> |
|
11 | - * @license http://www.netresearch.de Netresearch Copyright |
|
12 | - * @link http://www.netresearch.de |
|
13 | - */ |
|
3 | + * See class comment |
|
4 | + * |
|
5 | + * PHP Version 5 |
|
6 | + * |
|
7 | + * @category Netresearch |
|
8 | + * @package Netresearch\Kite |
|
9 | + * @subpackage Workflow |
|
10 | + * @author Christian Opitz <[email protected]> |
|
11 | + * @license http://www.netresearch.de Netresearch Copyright |
|
12 | + * @link http://www.netresearch.de |
|
13 | + */ |
|
14 | 14 | |
15 | 15 | namespace Netresearch\Kite\Workflow; |
16 | 16 | use Netresearch\Kite\Service\Factory; |
@@ -131,7 +131,7 @@ |
||
131 | 131 | public function assemble() |
132 | 132 | { |
133 | 133 | $this->callback( |
134 | - function () { |
|
134 | + function() { |
|
135 | 135 | $stages = $this->get('stages'); |
136 | 136 | $stageOptions = array(); |
137 | 137 | // Begin keys from 1 |