@@ -19,7 +19,6 @@ |
||
| 19 | 19 | use Netresearch\Kite\Exception; |
| 20 | 20 | use Netresearch\Kite\Service\Config; |
| 21 | 21 | use Netresearch\Kite\Console\Command\JobCommand; |
| 22 | -use Netresearch\Kite\Service\Factory; |
|
| 23 | 22 | use Symfony\Component\Console\Command\Command; |
| 24 | 23 | use Symfony\Component\Console\Input\InputInterface; |
| 25 | 24 | use Symfony\Component\Console\Input\InputOption; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | list($dir, $file) = $dirAndFile; |
| 82 | 82 | if (is_dir($dir)) { |
| 83 | 83 | $app = $appName; |
| 84 | - $expectedFile = $dir . '/' . $file; |
|
| 84 | + $expectedFile = $dir.'/'.$file; |
|
| 85 | 85 | break; |
| 86 | 86 | } |
| 87 | 87 | } |
@@ -91,9 +91,9 @@ discard block |
||
| 91 | 91 | } catch (\Exception $e) { |
| 92 | 92 | if ($app) { |
| 93 | 93 | $message = [ |
| 94 | - 'You appear to be in a ' . $app . ' root directory but', |
|
| 94 | + 'You appear to be in a '.$app.' root directory but', |
|
| 95 | 95 | 'there is no kite config file at the expected', |
| 96 | - 'location (' . $expectedFile . ').' |
|
| 96 | + 'location ('.$expectedFile.').' |
|
| 97 | 97 | ]; |
| 98 | 98 | } else { |
| 99 | 99 | $message = [ |
@@ -103,9 +103,9 @@ discard block |
||
| 103 | 103 | 'The config file path is expected to be:', |
| 104 | 104 | ]; |
| 105 | 105 | foreach ($indicators as $appName => $dirAndFile) { |
| 106 | - $message[] = ' - "' . implode('/', $dirAndFile) . '" for ' . $appName . ' applications or'; |
|
| 106 | + $message[] = ' - "'.implode('/', $dirAndFile).'" for '.$appName.' applications or'; |
|
| 107 | 107 | } |
| 108 | - $message[] = ' - "' . $expectedFile . '" for any other application'; |
|
| 108 | + $message[] = ' - "'.$expectedFile.'" for any other application'; |
|
| 109 | 109 | } |
| 110 | 110 | $lMax = 0; |
| 111 | 111 | foreach ($message as $line) { |
@@ -113,12 +113,12 @@ discard block |
||
| 113 | 113 | $lMax = $l; |
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | - $this->output->writeln('<warning>' . str_repeat(' ', $lMax + 4) . '</warning>'); |
|
| 116 | + $this->output->writeln('<warning>'.str_repeat(' ', $lMax + 4).'</warning>'); |
|
| 117 | 117 | foreach ($message as $line) { |
| 118 | 118 | $line = str_pad($line, $lMax + 2); |
| 119 | 119 | $this->output->writeln("<warning> $line</warning>"); |
| 120 | 120 | } |
| 121 | - $this->output->writeln('<warning>' . str_repeat(' ', $lMax + 4) . '</warning>'); |
|
| 121 | + $this->output->writeln('<warning>'.str_repeat(' ', $lMax + 4).'</warning>'); |
|
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | . "| ' /| | __/ _ \\\n" |
| 136 | 136 | . "| . \\| | |_| __/\n" |
| 137 | 137 | . "|_|\\_|_|\\__\\___|\n\n" |
| 138 | - . $this->getLongVersion() . "\n\n" |
|
| 138 | + . $this->getLongVersion()."\n\n" |
|
| 139 | 139 | . $this->getSelfPackage()->description; |
| 140 | 140 | |
| 141 | 141 | return $help; |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | if (isset($package->source)) { |
| 154 | 154 | $v .= " <comment>({$package->source->reference})</comment>"; |
| 155 | 155 | } |
| 156 | - $v .= ' ' . $package->time; |
|
| 156 | + $v .= ' '.$package->time; |
|
| 157 | 157 | return $v; |
| 158 | 158 | } |
| 159 | 159 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | { |
| 167 | 167 | static $package = null; |
| 168 | 168 | if (!$package) { |
| 169 | - $files = [__DIR__ . '/../../../../composer/installed.json', __DIR__ . '/vendor/composer/installed.json']; |
|
| 169 | + $files = [__DIR__.'/../../../../composer/installed.json', __DIR__.'/vendor/composer/installed.json']; |
|
| 170 | 170 | foreach ($files as $file) { |
| 171 | 171 | if (file_exists($file)) { |
| 172 | 172 | $installed = json_decode(file_get_contents($file)); |
@@ -183,9 +183,9 @@ discard block |
||
| 183 | 183 | $process = new Process('git symbolic-ref -q --short HEAD || git describe --tags --exact-match; git rev-parse HEAD; git show -s --format=%ct HEAD', $kitePath); |
| 184 | 184 | $process->run(); |
| 185 | 185 | if ($output = $process->getOutput()) { |
| 186 | - $package = json_decode(file_get_contents($kitePath . '/composer.json')); |
|
| 186 | + $package = json_decode(file_get_contents($kitePath.'/composer.json')); |
|
| 187 | 187 | list($name, $revision, $tstamp) = explode("\n", trim($output), 3); |
| 188 | - $package->version = preg_match('/^v?[0-9]+\.[0-9]+\.[0-9]+(-[a-z0-9]+)?$/i', $name) ? $name : 'dev-' . $name; |
|
| 188 | + $package->version = preg_match('/^v?[0-9]+\.[0-9]+\.[0-9]+(-[a-z0-9]+)?$/i', $name) ? $name : 'dev-'.$name; |
|
| 189 | 189 | $package->source = (object) ['reference' => $revision]; |
| 190 | 190 | $package->time = date('Y-m-d H:i:s', $tstamp); |
| 191 | 191 | } else { |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | $definition->addOption(new InputOption('workflow', null, InputOption::VALUE_OPTIONAL, 'Run a workflow on the fly')); |
| 208 | 208 | |
| 209 | 209 | if (isset($_SERVER['HOME']) && is_writable($_SERVER['HOME'])) { |
| 210 | - $debugDir = $_SERVER['HOME'] . '/.kite/log'; |
|
| 210 | + $debugDir = $_SERVER['HOME'].'/.kite/log'; |
|
| 211 | 211 | } else { |
| 212 | 212 | $debugDir = false; |
| 213 | 213 | } |
@@ -251,19 +251,19 @@ discard block |
||
| 251 | 251 | $strInput .= ' --help'; |
| 252 | 252 | } |
| 253 | 253 | $workflow = $input->getParameterOption('--workflow'); |
| 254 | - $jobName = 'generic:workflow:' . $workflow; |
|
| 254 | + $jobName = 'generic:workflow:'.$workflow; |
|
| 255 | 255 | $this->config->configureJob($jobName, array('workflow' => $workflow)); |
| 256 | 256 | $command = new JobCommand($jobName, $this->config); |
| 257 | 257 | $this->add($command); |
| 258 | 258 | |
| 259 | - $parameterOption = '--workflow=' . $workflow; |
|
| 259 | + $parameterOption = '--workflow='.$workflow; |
|
| 260 | 260 | $input = new StringInput( |
| 261 | 261 | rtrim( |
| 262 | - $jobName . ' ' . |
|
| 262 | + $jobName.' '. |
|
| 263 | 263 | str_replace( |
| 264 | 264 | array( |
| 265 | - $parameterOption . ' ', |
|
| 266 | - ' ' . $parameterOption, |
|
| 265 | + $parameterOption.' ', |
|
| 266 | + ' '.$parameterOption, |
|
| 267 | 267 | $parameterOption |
| 268 | 268 | ), '', $strInput |
| 269 | 269 | ) |
@@ -15,7 +15,6 @@ |
||
| 15 | 15 | namespace Netresearch\Kite\Service; |
| 16 | 16 | |
| 17 | 17 | use Netresearch\Kite\Console\Output\Output; |
| 18 | - |
|
| 19 | 18 | use Symfony\Component\Console\Application; |
| 20 | 19 | use Symfony\Component\Console\Helper; |
| 21 | 20 | use Symfony\Component\Console\Input\InputInterface; |
@@ -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 | /** |
@@ -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 |
@@ -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 | |
@@ -77,7 +77,7 @@ discard block |
||
| 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); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | if ($delete) { |
| 102 | 102 | $this->git('branch', $package->path, array('d' => $mergeBranch)); |
| 103 | - $this->git('push', $package->path, array('origin', ':' . $mergeBranch)); |
|
| 103 | + $this->git('push', $package->path, array('origin', ':'.$mergeBranch)); |
|
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | |
@@ -142,10 +142,10 @@ discard block |
||
| 142 | 142 | $package->branches[] = $checkoutBranch; |
| 143 | 143 | $inferFromBranch = 'master'; |
| 144 | 144 | } |
| 145 | - $this->git('fetch', $package->path, array('force' => true, 'origin', $inferFromBranch . ':' . $checkoutBranch)); |
|
| 145 | + $this->git('fetch', $package->path, array('force' => true, 'origin', $inferFromBranch.':'.$checkoutBranch)); |
|
| 146 | 146 | $this->git('checkout', $package->path, array($checkoutBranch)); |
| 147 | 147 | $package->branch = $checkoutBranch; |
| 148 | - $package->version = 'dev-' . $checkoutBranch; |
|
| 148 | + $package->version = 'dev-'.$checkoutBranch; |
|
| 149 | 149 | } else { |
| 150 | 150 | continue; |
| 151 | 151 | } |
@@ -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 | /** |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | if (!$rollback && !$restore) { |
| 89 | 89 | $this->checkout(); |
| 90 | 90 | $this->release = date($this->get('releaseFormat', 'YmdHis')); |
| 91 | - $this->set('releaseDir', 'releases/' . $this->release); |
|
| 91 | + $this->set('releaseDir', 'releases/'.$this->release); |
|
| 92 | 92 | $this->release(); |
| 93 | 93 | $this->shareResources(); |
| 94 | 94 | } |
@@ -195,9 +195,9 @@ discard block |
||
| 195 | 195 | protected function activate() |
| 196 | 196 | { |
| 197 | 197 | $sub = $this->iterate('{nodes}', 'node'); |
| 198 | - $sub->message('<step>Activating ' . ($this->release ? 'new' : 'latest') . ' release</step>'); |
|
| 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 | |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | |
| 214 | 214 | $commands = array("ln -sfn $next current; rm next"); |
| 215 | 215 | if ($current) { |
| 216 | - $from = '<comment>' . basename($current) . '</comment>'; |
|
| 216 | + $from = '<comment>'.basename($current).'</comment>'; |
|
| 217 | 217 | array_unshift($commands, "ln -s $current previous"); |
| 218 | 218 | if ($previous) { |
| 219 | 219 | array_unshift($commands, "rm previous; rm -rf $previous"); |
@@ -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) { |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | $commands = array("ln -sfn $previous current; rm previous"); |
| 270 | 270 | if ($current) { |
| 271 | 271 | array_unshift($commands, "ln -s $current next"); |
| 272 | - $from = '<comment>' . basename($current) . '</comment>'; |
|
| 272 | + $from = '<comment>'.basename($current).'</comment>'; |
|
| 273 | 273 | } else { |
| 274 | 274 | $from = '<warning>none</warning>'; |
| 275 | 275 | } |
@@ -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); |
@@ -311,13 +311,13 @@ discard block |
||
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | $commands[] = 'cd {releaseDir}'; |
| 314 | - $commands[] = 'rm -rf ' . $entry; |
|
| 314 | + $commands[] = 'rm -rf '.$entry; |
|
| 315 | 315 | if ($dirName) { |
| 316 | - $commands[] = 'mkdir -p ' . $dirName; |
|
| 317 | - $commands[] = 'cd ' . $dirName; |
|
| 316 | + $commands[] = 'mkdir -p '.$dirName; |
|
| 317 | + $commands[] = 'cd '.$dirName; |
|
| 318 | 318 | $subDirCount += substr_count($dirName, '/') + 1; |
| 319 | 319 | } |
| 320 | - $commands[] = 'ln -s ' . str_repeat('../', $subDirCount) . $shareDir . '/' . $entry; |
|
| 320 | + $commands[] = 'ln -s '.str_repeat('../', $subDirCount).$shareDir.'/'.$entry; |
|
| 321 | 321 | |
| 322 | 322 | $iterator->remoteShell($commands, '{node.deployPath}'); |
| 323 | 323 | } |
@@ -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 | /** |
@@ -131,7 +131,7 @@ discard block |
||
| 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 |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | $task = clone $this->task; |
| 177 | 177 | foreach ($stages[$stage] as $key => $value) { |
| 178 | 178 | // Avoid variables overriding parent variables, by prefixing with this |
| 179 | - $task->set('this.' . $key, $value); |
|
| 179 | + $task->set('this.'.$key, $value); |
|
| 180 | 180 | } |
| 181 | 181 | $this->addTask($task); |
| 182 | 182 | } |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | ], |
| 50 | 50 | 'task' => [ |
| 51 | 51 | 'type' => 'callback', |
| 52 | - 'callback' => function (\Netresearch\Kite\Job $job) { |
|
| 52 | + 'callback' => function(\Netresearch\Kite\Job $job) { |
|
| 53 | 53 | $git = $job->get('git'); |
| 54 | 54 | $command = $job->get('cmd'); |
| 55 | 55 | foreach ($job->get('composer.packages') as $package) { |
@@ -172,10 +172,10 @@ |
||
| 172 | 172 | } |
| 173 | 173 | if ($isTest) { |
| 174 | 174 | if ($isFunctionCall) { |
| 175 | - throw new SyntaxError('Can\'t use function return value in write context', $stream->current->cursor); |
|
| 175 | + throw new SyntaxError('Can\'t use function return value in write context', $stream->current->cursor); |
|
| 176 | 176 | } |
| 177 | 177 | if (!$stream->current->test(Token::PUNCTUATION_TYPE, ')')) { |
| 178 | - throw new SyntaxError('Expected )', $stream->current->cursor); |
|
| 178 | + throw new SyntaxError('Expected )', $stream->current->cursor); |
|
| 179 | 179 | } |
| 180 | 180 | $tokens[] = new Token(Token::STRING_TYPE, implode('.', $names), $token->cursor); |
| 181 | 181 | } else { |