@@ -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) { |
@@ -27,9 +27,9 @@ |
||
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | -if ((!$loader = includeIfExists(__DIR__.'/vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__.'/../../autoload.php'))) { |
|
| 31 | - die('You must set up the project dependencies, run the following commands:'.PHP_EOL. |
|
| 32 | - 'curl -s http://getcomposer.org/installer | php'.PHP_EOL. |
|
| 33 | - 'php composer.phar install'.PHP_EOL); |
|
| 30 | +if ((!$loader = includeIfExists(__DIR__ . '/vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__ . '/../../autoload.php'))) { |
|
| 31 | + die('You must set up the project dependencies, run the following commands:' . PHP_EOL . |
|
| 32 | + 'curl -s http://getcomposer.org/installer | php' . PHP_EOL . |
|
| 33 | + 'php composer.phar install' . PHP_EOL); |
|
| 34 | 34 | } |
| 35 | 35 | ?> |
@@ -179,7 +179,7 @@ |
||
| 179 | 179 | } |
| 180 | 180 | } |
| 181 | 181 | } elseif (!is_subclass_of(ltrim($definition, '\\'), 'Netresearch\\Kite\\' . $ucType)) { |
| 182 | - throw new Exception($definition .' must extend Netresearch\\Kite\\' . $ucType); |
|
| 182 | + throw new Exception($definition . ' must extend Netresearch\\Kite\\' . $ucType); |
|
| 183 | 183 | } |
| 184 | 184 | return $definition; |
| 185 | 185 | } |
@@ -148,7 +148,7 @@ |
||
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | parent::run( |
| 151 | - function ($type, $buffer) use ($callback) { |
|
| 151 | + function($type, $buffer) use ($callback) { |
|
| 152 | 152 | if ($callback) { |
| 153 | 153 | call_user_func($callback, $type, $buffer); |
| 154 | 154 | } |
@@ -272,7 +272,7 @@ |
||
| 272 | 272 | } elseif ($create) { |
| 273 | 273 | $branches = array_unique( |
| 274 | 274 | array_map( |
| 275 | - function ($el) { |
|
| 275 | + function($el) { |
|
| 276 | 276 | $parts = explode('/', $el); |
| 277 | 277 | return array_pop($parts); |
| 278 | 278 | }, |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | public function assemble() |
| 61 | 61 | { |
| 62 | 62 | $this->callback( |
| 63 | - function () { |
|
| 63 | + function() { |
|
| 64 | 64 | $this->findLoaders(); |
| 65 | 65 | $file = $this->get('file'); |
| 66 | 66 | $this->console->getFilesystem()->ensureDirectoryExists(dirname($file)); |
@@ -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); |
@@ -81,66 +81,66 @@ |
||
| 81 | 81 | parent::registerFunctions(); |
| 82 | 82 | $this->register( |
| 83 | 83 | 'confirm', |
| 84 | - function ($question) { |
|
| 84 | + function($question) { |
|
| 85 | 85 | }, |
| 86 | - function (array $values, $question) { |
|
| 86 | + function(array $values, $question) { |
|
| 87 | 87 | return $this->ask($values[self::VARIABLES_KEY], new ConfirmationQuestion("<question>$question</question> [y] ")); |
| 88 | 88 | } |
| 89 | 89 | ); |
| 90 | 90 | $this->register( |
| 91 | 91 | 'answer', |
| 92 | - function ($question) { |
|
| 92 | + function($question) { |
|
| 93 | 93 | }, |
| 94 | - function (array $values, $question) { |
|
| 94 | + function(array $values, $question) { |
|
| 95 | 95 | return $this->ask($values[self::VARIABLES_KEY], new Question("<question>$question</question> ")); |
| 96 | 96 | } |
| 97 | 97 | ); |
| 98 | 98 | $this->register( |
| 99 | 99 | 'choose', |
| 100 | - function ($question) { |
|
| 100 | + function($question) { |
|
| 101 | 101 | }, |
| 102 | - function (array $values, $question, array $choices) { |
|
| 102 | + function(array $values, $question, array $choices) { |
|
| 103 | 103 | return $this->ask($values[self::VARIABLES_KEY], new ChoiceQuestion("<question>$question</question> ", $choices)); |
| 104 | 104 | } |
| 105 | 105 | ); |
| 106 | 106 | $this->register( |
| 107 | 107 | 'isset', |
| 108 | - function ($var) { |
|
| 108 | + function($var) { |
|
| 109 | 109 | }, |
| 110 | - function (array $values, $var) { |
|
| 110 | + function(array $values, $var) { |
|
| 111 | 111 | return $values[self::VARIABLES_KEY]->has($var); |
| 112 | 112 | } |
| 113 | 113 | ); |
| 114 | 114 | $this->register( |
| 115 | 115 | 'empty', |
| 116 | - function ($var) { |
|
| 116 | + function($var) { |
|
| 117 | 117 | }, |
| 118 | - function (array $values, $var) { |
|
| 118 | + function(array $values, $var) { |
|
| 119 | 119 | return $values[self::VARIABLES_KEY]->has($var) && $values[self::VARIABLES_KEY]->get($var); |
| 120 | 120 | } |
| 121 | 121 | ); |
| 122 | 122 | $this->register( |
| 123 | 123 | 'get', |
| 124 | - function () { |
|
| 124 | + function() { |
|
| 125 | 125 | }, |
| 126 | - function (array $values, $var) { |
|
| 126 | + function(array $values, $var) { |
|
| 127 | 127 | return $values[self::VARIABLES_KEY]->get($var); |
| 128 | 128 | } |
| 129 | 129 | ); |
| 130 | 130 | $this->register( |
| 131 | 131 | 'set', |
| 132 | - function () { |
|
| 132 | + function() { |
|
| 133 | 133 | }, |
| 134 | - function (array $values, $var, $value) { |
|
| 134 | + function(array $values, $var, $value) { |
|
| 135 | 135 | $values[self::VARIABLES_KEY]->set($var, $value); |
| 136 | 136 | return $value; |
| 137 | 137 | } |
| 138 | 138 | ); |
| 139 | 139 | $this->register( |
| 140 | 140 | 'replace', |
| 141 | - function () { |
|
| 141 | + function() { |
|
| 142 | 142 | }, |
| 143 | - function (array $values, $search, $replace, $subject, $regex = false) { |
|
| 143 | + function(array $values, $search, $replace, $subject, $regex = false) { |
|
| 144 | 144 | if ($regex) { |
| 145 | 145 | return preg_replace($search, $replace, $subject); |
| 146 | 146 | } else { |
@@ -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 { |