@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $dealersHand = []; |
| 81 | 81 | $playersHand = []; |
| 82 | 82 | shuffle($deck); |
| 83 | - $deal = function () use (&$deck, &$graveyard) { |
|
| 83 | + $deal = function() use (&$deck, &$graveyard) { |
|
| 84 | 84 | if (count($deck) == 0) { |
| 85 | 85 | shuffle($graveyard); |
| 86 | 86 | $deck = $graveyard; |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | } |
| 288 | 288 | $variants = [$value]; |
| 289 | 289 | while ($aces-- > 0) { |
| 290 | - $variants = array_flatten(array_map(function ($v) { |
|
| 290 | + $variants = array_flatten(array_map(function($v) { |
|
| 291 | 291 | return [$v + 1, $v + 11]; |
| 292 | 292 | }, $variants)); |
| 293 | 293 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $labels = $host->get('labels', []); |
| 54 | 54 | $labels['alias'] = $host->getAlias(); |
| 55 | 55 | $labels['true'] = 'true'; |
| 56 | - $isTrue = function ($value) { |
|
| 56 | + $isTrue = function($value) { |
|
| 57 | 57 | return $value; |
| 58 | 58 | }; |
| 59 | 59 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | private static function compare(string $op, $a, ?string $b): bool |
| 76 | 76 | { |
| 77 | - $matchFunction = function ($a, ?string $b) { |
|
| 77 | + $matchFunction = function($a, ?string $b) { |
|
| 78 | 78 | foreach ((array) $a as $item) { |
| 79 | 79 | if ($item === $b) { |
| 80 | 80 | return true; |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | { |
| 52 | 52 | foreach ($this->recipes as $recipe) { |
| 53 | 53 | // $find will try to return DocConfig for a given config $name. |
| 54 | - $findConfig = function (string $name) use ($recipe): ?DocConfig { |
|
| 54 | + $findConfig = function(string $name) use ($recipe): ?DocConfig { |
|
| 55 | 55 | if (array_key_exists($name, $recipe->config)) { |
| 56 | 56 | return $recipe->config[$name]; |
| 57 | 57 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | return null; |
| 71 | 71 | }; |
| 72 | - $findConfigOverride = function (DocRecipe $recipe, string $name) use (&$findConfigOverride): ?DocConfig { |
|
| 72 | + $findConfigOverride = function(DocRecipe $recipe, string $name) use (&$findConfigOverride): ?DocConfig { |
|
| 73 | 73 | foreach ($recipe->require as $r) { |
| 74 | 74 | if (array_key_exists($r, $this->recipes)) { |
| 75 | 75 | if (array_key_exists($name, $this->recipes[$r]->config)) { |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | return null; |
| 86 | 86 | }; |
| 87 | 87 | // Replace all {{name}} with link to correct config declaration. |
| 88 | - $replaceLinks = function (string $comment) use ($findConfig): string { |
|
| 88 | + $replaceLinks = function(string $comment) use ($findConfig): string { |
|
| 89 | 89 | $output = ''; |
| 90 | 90 | $code = false; |
| 91 | 91 | foreach (explode("\n", $comment) as $i => $line) { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $output .= "\n"; |
| 98 | 98 | continue; |
| 99 | 99 | } |
| 100 | - $output .= preg_replace_callback('#(\{\{(?<name>[\w_:\-/]+)\}\})#', function ($m) use ($findConfig) { |
|
| 100 | + $output .= preg_replace_callback('#(\{\{(?<name>[\w_:\-/]+)\}\})#', function($m) use ($findConfig) { |
|
| 101 | 101 | $name = $m['name']; |
| 102 | 102 | $config = $findConfig($name); |
| 103 | 103 | if ($config !== null) { |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | } |
| 112 | 112 | return $output; |
| 113 | 113 | }; |
| 114 | - $findTask = function (string $name, bool $searchOtherRecipes = true) use ($recipe): ?DocTask { |
|
| 114 | + $findTask = function(string $name, bool $searchOtherRecipes = true) use ($recipe): ?DocTask { |
|
| 115 | 115 | if (array_key_exists($name, $recipe->tasks)) { |
| 116 | 116 | return $recipe->tasks[$name]; |
| 117 | 117 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | |
| 171 | 171 | MARKDOWN; |
| 172 | 172 | |
| 173 | - $map = function (DocTask $task, $ident = '') use (&$map, $findTask, &$intro): void { |
|
| 173 | + $map = function(DocTask $task, $ident = '') use (&$map, $findTask, &$intro): void { |
|
| 174 | 174 | foreach ($task->group as $taskName) { |
| 175 | 175 | $t = $findTask($taskName); |
| 176 | 176 | if ($t !== null) { |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | |
| 357 | 357 | function indent(string $text): string |
| 358 | 358 | { |
| 359 | - return implode("\n", array_map(function ($line) { |
|
| 359 | + return implode("\n", array_map(function($line) { |
|
| 360 | 360 | return " " . $line; |
| 361 | 361 | }, explode("\n", $text))); |
| 362 | 362 | } |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | * Silverstripe configuration |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | -set('shared_assets', function () { |
|
| 13 | +set('shared_assets', function() { |
|
| 14 | 14 | if (test('[ -d {{release_or_current_path}}/public ]') || test('[ -d {{deploy_path}}/shared/public ]')) { |
| 15 | 15 | return 'public/assets'; |
| 16 | 16 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | ]); |
| 30 | 30 | |
| 31 | 31 | // Silverstripe cli script |
| 32 | -set('silverstripe_cli_script', function () { |
|
| 32 | +set('silverstripe_cli_script', function() { |
|
| 33 | 33 | $paths = [ |
| 34 | 34 | 'framework/cli-script.php', |
| 35 | 35 | 'vendor/silverstripe/framework/cli-script.php', |
@@ -45,12 +45,12 @@ discard block |
||
| 45 | 45 | * Helper tasks |
| 46 | 46 | */ |
| 47 | 47 | desc('Runs /dev/build'); |
| 48 | -task('silverstripe:build', function () { |
|
| 48 | +task('silverstripe:build', function() { |
|
| 49 | 49 | run('{{bin/php}} {{release_or_current_path}}/{{silverstripe_cli_script}} /dev/build'); |
| 50 | 50 | }); |
| 51 | 51 | |
| 52 | 52 | desc('Runs /dev/build?flush=all'); |
| 53 | -task('silverstripe:buildflush', function () { |
|
| 53 | +task('silverstripe:buildflush', function() { |
|
| 54 | 54 | run('{{bin/php}} {{release_or_current_path}}/{{silverstripe_cli_script}} /dev/build flush=all'); |
| 55 | 55 | }); |
| 56 | 56 | |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | namespace Deployer; |
| 4 | 4 | |
| 5 | 5 | desc('Prepares host for deploy'); |
| 6 | -task('deploy:setup', function () { |
|
| 6 | +task('deploy:setup', function() { |
|
| 7 | 7 | run( |
| 8 | 8 | <<<EOF |
| 9 | 9 | [ -d {{deploy_path}} ] || mkdir -p {{deploy_path}}; |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | //Create and upload Drupal 7 settings.php using values from secrets |
| 34 | -task('drupal:settings', function () { |
|
| 34 | +task('drupal:settings', function() { |
|
| 35 | 35 | if (askConfirmation('Are you sure to generate and upload settings.php file?')) { |
| 36 | 36 | |
| 37 | 37 | //Get template |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | }); |
| 74 | 74 | |
| 75 | 75 | //Upload Drupal 7 files folder |
| 76 | -task('drupal:upload_files', function () { |
|
| 76 | +task('drupal:upload_files', function() { |
|
| 77 | 77 | if (askConfirmation('Are you sure?')) { |
| 78 | 78 | upload('sites/{{drupal_site}}/files', '{{deploy_path}}/shared/sites/{{drupal_site}}/files'); |
| 79 | 79 | } |
@@ -36,13 +36,13 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | function craft($command, $options = []) |
| 38 | 38 | { |
| 39 | - return function () use ($command, $options) { |
|
| 40 | - if (! test('[ -s {{release_path}}/.env ]')) { |
|
| 39 | + return function() use ($command, $options) { |
|
| 40 | + if (!test('[ -s {{release_path}}/.env ]')) { |
|
| 41 | 41 | throw new \Exception('Your .env file is empty! Cannot proceed.'); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | // By default we don't want any command to be interactive |
| 45 | - if (! in_array('interactive', $options)) { |
|
| 45 | + if (!in_array('interactive', $options)) { |
|
| 46 | 46 | $command .= ' --interactive=0'; |
| 47 | 47 | } |
| 48 | 48 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | // Update using: `set('static_content_jobs', '1');` |
| 65 | 65 | set('static_content_jobs', '1'); |
| 66 | 66 | |
| 67 | -set('content_version', function () { |
|
| 67 | +set('content_version', function() { |
|
| 68 | 68 | return time(); |
| 69 | 69 | }); |
| 70 | 70 | |
@@ -109,14 +109,14 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | set('bin/magento', '{{release_or_current_path}}/{{magento_dir}}/bin/magento'); |
| 111 | 111 | |
| 112 | -set('magento_version', function () { |
|
| 112 | +set('magento_version', function() { |
|
| 113 | 113 | // detect version |
| 114 | 114 | $versionOutput = run('{{bin/php}} {{bin/magento}} --version'); |
| 115 | 115 | preg_match('/(\d+\.?)+(-p\d+)?$/', $versionOutput, $matches); |
| 116 | 116 | return $matches[0] ?? '2.0'; |
| 117 | 117 | }); |
| 118 | 118 | |
| 119 | -set('config_import_needed', function () { |
|
| 119 | +set('config_import_needed', function() { |
|
| 120 | 120 | // detect if app:config:import is needed |
| 121 | 121 | try { |
| 122 | 122 | run('{{bin/php}} {{bin/magento}} app:config:status'); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | return false; |
| 131 | 131 | }); |
| 132 | 132 | |
| 133 | -set('database_upgrade_needed', function () { |
|
| 133 | +set('database_upgrade_needed', function() { |
|
| 134 | 134 | // detect if setup:upgrade is needed |
| 135 | 135 | try { |
| 136 | 136 | run('{{bin/php}} {{bin/magento}} setup:db:status'); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | // 'MAGE_MODE' => 'production' |
| 166 | 166 | // ``` |
| 167 | 167 | desc('Compiles magento di'); |
| 168 | -task('magento:compile', function () { |
|
| 168 | +task('magento:compile', function() { |
|
| 169 | 169 | run("{{bin/php}} {{bin/magento}} setup:di:compile"); |
| 170 | 170 | run('cd {{release_or_current_path}}/{{magento_dir}} && {{bin/composer}} dump-autoload -o'); |
| 171 | 171 | }); |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | // ] |
| 192 | 192 | // ``` |
| 193 | 193 | desc('Deploys assets'); |
| 194 | -task('magento:deploy:assets', function () { |
|
| 194 | +task('magento:deploy:assets', function() { |
|
| 195 | 195 | $themesToCompile = ''; |
| 196 | 196 | if (get('split_static_deployment')) { |
| 197 | 197 | invoke('magento:deploy:assets:adminhtml'); |
@@ -208,12 +208,12 @@ discard block |
||
| 208 | 208 | }); |
| 209 | 209 | |
| 210 | 210 | desc('Deploys assets for backend only'); |
| 211 | -task('magento:deploy:assets:adminhtml', function () { |
|
| 211 | +task('magento:deploy:assets:adminhtml', function() { |
|
| 212 | 212 | magentoDeployAssetsSplit('backend'); |
| 213 | 213 | }); |
| 214 | 214 | |
| 215 | 215 | desc('Deploys assets for frontend only'); |
| 216 | -task('magento:deploy:assets:frontend', function () { |
|
| 216 | +task('magento:deploy:assets:frontend', function() { |
|
| 217 | 217 | magentoDeployAssetsSplit('frontend'); |
| 218 | 218 | }); |
| 219 | 219 | |
@@ -261,9 +261,9 @@ discard block |
||
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | desc('Syncs content version'); |
| 264 | -task('magento:sync:content_version', function () { |
|
| 264 | +task('magento:sync:content_version', function() { |
|
| 265 | 265 | $timestamp = time(); |
| 266 | - on(select('all'), function (Host $host) use ($timestamp) { |
|
| 266 | + on(select('all'), function(Host $host) use ($timestamp) { |
|
| 267 | 267 | $host->set('content_version', $timestamp); |
| 268 | 268 | }); |
| 269 | 269 | })->once(); |
@@ -271,26 +271,25 @@ discard block |
||
| 271 | 271 | before('magento:deploy:assets', 'magento:sync:content_version'); |
| 272 | 272 | |
| 273 | 273 | desc('Enables maintenance mode'); |
| 274 | -task('magento:maintenance:enable', function () { |
|
| 274 | +task('magento:maintenance:enable', function() { |
|
| 275 | 275 | // do not use {{bin/magento}} because it would be in "release" but the maintenance mode must be set in "current" |
| 276 | 276 | run("if [ -d $(echo {{current_path}}) ]; then {{bin/php}} {{current_path}}/{{magento_dir}}/bin/magento maintenance:enable; fi"); |
| 277 | 277 | }); |
| 278 | 278 | |
| 279 | 279 | desc('Disables maintenance mode'); |
| 280 | -task('magento:maintenance:disable', function () { |
|
| 280 | +task('magento:maintenance:disable', function() { |
|
| 281 | 281 | // do not use {{bin/magento}} because it would be in "release" but the maintenance mode must be set in "current" |
| 282 | 282 | run("if [ -d $(echo {{current_path}}) ]; then {{bin/php}} {{current_path}}/{{magento_dir}}/bin/magento maintenance:disable; fi"); |
| 283 | 283 | }); |
| 284 | 284 | |
| 285 | 285 | desc('Set maintenance mode if needed'); |
| 286 | -task('magento:maintenance:enable-if-needed', function () { |
|
| 287 | - ! get('enable_zerodowntime') || get('database_upgrade_needed') || get('config_import_needed') ? |
|
| 288 | - invoke('magento:maintenance:enable') : |
|
| 289 | - writeln('Config and database up to date => no maintenance mode'); |
|
| 286 | +task('magento:maintenance:enable-if-needed', function() { |
|
| 287 | + !get('enable_zerodowntime') || get('database_upgrade_needed') || get('config_import_needed') ? |
|
| 288 | + invoke('magento:maintenance:enable') : writeln('Config and database up to date => no maintenance mode'); |
|
| 290 | 289 | }); |
| 291 | 290 | |
| 292 | 291 | desc('Config Import'); |
| 293 | -task('magento:config:import', function () { |
|
| 292 | +task('magento:config:import', function() { |
|
| 294 | 293 | if (get('config_import_needed')) { |
| 295 | 294 | run('{{bin/php}} {{bin/magento}} app:config:import --no-interaction'); |
| 296 | 295 | } else { |
@@ -299,7 +298,7 @@ discard block |
||
| 299 | 298 | }); |
| 300 | 299 | |
| 301 | 300 | desc('Upgrades magento database'); |
| 302 | -task('magento:upgrade:db', function () { |
|
| 301 | +task('magento:upgrade:db', function() { |
|
| 303 | 302 | if (get('database_upgrade_needed')) { |
| 304 | 303 | run("{{bin/php}} {{bin/magento}} setup:db-schema:upgrade --no-interaction"); |
| 305 | 304 | run("{{bin/php}} {{bin/magento}} setup:db-data:upgrade --no-interaction"); |
@@ -309,7 +308,7 @@ discard block |
||
| 309 | 308 | })->once(); |
| 310 | 309 | |
| 311 | 310 | desc('Flushes Magento Cache'); |
| 312 | -task('magento:cache:flush', function () { |
|
| 311 | +task('magento:cache:flush', function() { |
|
| 313 | 312 | run("{{bin/php}} {{bin/magento}} cache:flush"); |
| 314 | 313 | }); |
| 315 | 314 | |
@@ -360,7 +359,7 @@ discard block |
||
| 360 | 359 | set('repository', null); |
| 361 | 360 | |
| 362 | 361 | // The relative path to the artifact file. If the directory does not exist, it will be created |
| 363 | -set('artifact_path', function () { |
|
| 362 | +set('artifact_path', function() { |
|
| 364 | 363 | if (!testLocally('[ -d {{artifact_dir}} ]')) { |
| 365 | 364 | runLocally('mkdir -p {{artifact_dir}}'); |
| 366 | 365 | } |
@@ -368,7 +367,7 @@ discard block |
||
| 368 | 367 | }); |
| 369 | 368 | |
| 370 | 369 | // The location of the tar command. On MacOS you should have installed gtar, as it supports the required settings |
| 371 | -set('bin/tar', function () { |
|
| 370 | +set('bin/tar', function() { |
|
| 372 | 371 | if (commandExist('gtar')) { |
| 373 | 372 | return which('gtar'); |
| 374 | 373 | } else { |
@@ -379,7 +378,7 @@ discard block |
||
| 379 | 378 | // tasks section |
| 380 | 379 | |
| 381 | 380 | desc('Packages all relevant files in an artifact.'); |
| 382 | -task('artifact:package', function () { |
|
| 381 | +task('artifact:package', function() { |
|
| 383 | 382 | if (!test('[ -f {{artifact_excludes_file}} ]')) { |
| 384 | 383 | throw new GracefulShutdownException( |
| 385 | 384 | "No artifact excludes file provided, provide one at artifacts/excludes or change location", |
@@ -389,23 +388,23 @@ discard block |
||
| 389 | 388 | }); |
| 390 | 389 | |
| 391 | 390 | desc('Uploads artifact in release folder for extraction.'); |
| 392 | -task('artifact:upload', function () { |
|
| 391 | +task('artifact:upload', function() { |
|
| 393 | 392 | upload(get('artifact_path'), '{{release_path}}'); |
| 394 | 393 | }); |
| 395 | 394 | |
| 396 | 395 | desc('Extracts artifact in release path.'); |
| 397 | -task('artifact:extract', function () { |
|
| 396 | +task('artifact:extract', function() { |
|
| 398 | 397 | run('{{bin/tar}} -xzpf {{release_path}}/{{artifact_file}} -C {{release_path}}'); |
| 399 | 398 | run('rm -rf {{release_path}}/{{artifact_file}}'); |
| 400 | 399 | }); |
| 401 | 400 | |
| 402 | 401 | desc('Clears generated files prior to building.'); |
| 403 | -task('build:remove-generated', function () { |
|
| 402 | +task('build:remove-generated', function() { |
|
| 404 | 403 | run('rm -rf generated/*'); |
| 405 | 404 | }); |
| 406 | 405 | |
| 407 | 406 | desc('Prepare local artifact build'); |
| 408 | -task('build:prepare', function () { |
|
| 407 | +task('build:prepare', function() { |
|
| 409 | 408 | if (!currentHost()->get('local')) { |
| 410 | 409 | throw new GracefulShutdownException('Artifact can only be built locally, you provided a non local host'); |
| 411 | 410 | } |
@@ -446,7 +445,7 @@ discard block |
||
| 446 | 445 | |
| 447 | 446 | |
| 448 | 447 | desc('Adds additional files and dirs to the list of shared files and dirs'); |
| 449 | -task('deploy:additional-shared', function () { |
|
| 448 | +task('deploy:additional-shared', function() { |
|
| 450 | 449 | add('shared_files', get('additional_shared_files')); |
| 451 | 450 | add('shared_dirs', get('additional_shared_dirs')); |
| 452 | 451 | }); |
@@ -461,7 +460,7 @@ discard block |
||
| 461 | 460 | * ``` |
| 462 | 461 | **/ |
| 463 | 462 | desc('Update cache id_prefix'); |
| 464 | -task('magento:set_cache_prefix', function () { |
|
| 463 | +task('magento:set_cache_prefix', function() { |
|
| 465 | 464 | //download current env config |
| 466 | 465 | $tmpConfigFile = tempnam(sys_get_temp_dir(), 'deployer_config'); |
| 467 | 466 | download('{{deploy_path}}/shared/' . ENV_CONFIG_FILE_PATH, $tmpConfigFile); |
@@ -501,7 +500,7 @@ discard block |
||
| 501 | 500 | * After successful deployment, move the tmp_env.php file to env.php ready for next deployment |
| 502 | 501 | */ |
| 503 | 502 | desc('Cleanup cache id_prefix env files'); |
| 504 | -task('magento:cleanup_cache_prefix', function () { |
|
| 503 | +task('magento:cleanup_cache_prefix', function() { |
|
| 505 | 504 | run('rm {{deploy_path}}/shared/' . ENV_CONFIG_FILE_PATH); |
| 506 | 505 | run('rm {{release_or_current_path}}/' . ENV_CONFIG_FILE_PATH); |
| 507 | 506 | run('mv {{deploy_path}}/shared/' . TMP_ENV_CONFIG_FILE_PATH . ' {{deploy_path}}/shared/' . ENV_CONFIG_FILE_PATH); |
@@ -517,7 +516,7 @@ discard block |
||
| 517 | 516 | * ``` |
| 518 | 517 | */ |
| 519 | 518 | desc('Remove cron from crontab and kill running cron jobs'); |
| 520 | -task('magento:cron:stop', function () { |
|
| 519 | +task('magento:cron:stop', function() { |
|
| 521 | 520 | if (has('previous_release')) { |
| 522 | 521 | run('{{bin/php}} {{previous_release}}/{{magento_dir}}/bin/magento cron:remove'); |
| 523 | 522 | } |
@@ -533,7 +532,7 @@ discard block |
||
| 533 | 532 | * ``` |
| 534 | 533 | */ |
| 535 | 534 | desc('Install cron in crontab'); |
| 536 | -task('magento:cron:install', function () { |
|
| 535 | +task('magento:cron:install', function() { |
|
| 537 | 536 | run('cd {{release_or_current_path}}'); |
| 538 | 537 | run('{{bin/php}} {{bin/magento}} cron:install'); |
| 539 | 538 | }); |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | public function testTask() |
| 72 | 72 | { |
| 73 | - task('task', function () {}); |
|
| 73 | + task('task', function() {}); |
|
| 74 | 74 | |
| 75 | 75 | $task = $this->deployer->tasks->get('task'); |
| 76 | 76 | self::assertInstanceOf(Task::class, $task); |
@@ -85,10 +85,10 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | public function testBefore() |
| 87 | 87 | { |
| 88 | - task('main', function () {}); |
|
| 89 | - task('before', function () {}); |
|
| 88 | + task('main', function() {}); |
|
| 89 | + task('before', function() {}); |
|
| 90 | 90 | before('main', 'before'); |
| 91 | - before('before', function () {}); |
|
| 91 | + before('before', function() {}); |
|
| 92 | 92 | |
| 93 | 93 | $names = $this->taskToNames($this->deployer->scriptManager->getTasks('main')); |
| 94 | 94 | self::assertEquals(['before:before', 'before', 'main'], $names); |
@@ -96,10 +96,10 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | public function testAfter() |
| 98 | 98 | { |
| 99 | - task('main', function () {}); |
|
| 100 | - task('after', function () {}); |
|
| 99 | + task('main', function() {}); |
|
| 100 | + task('after', function() {}); |
|
| 101 | 101 | after('main', 'after'); |
| 102 | - after('after', function () {}); |
|
| 102 | + after('after', function() {}); |
|
| 103 | 103 | |
| 104 | 104 | $names = $this->taskToNames($this->deployer->scriptManager->getTasks('main')); |
| 105 | 105 | self::assertEquals(['main', 'after', 'after:after'], $names); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | { |
| 131 | 131 | Context::get()->getConfig()->set('working_path', '/foo'); |
| 132 | 132 | |
| 133 | - within('/bar', function () { |
|
| 133 | + within('/bar', function() { |
|
| 134 | 134 | $withinWorkingPath = Context::get()->getConfig()->get('working_path'); |
| 135 | 135 | self::assertEquals('/bar', $withinWorkingPath); |
| 136 | 136 | }); |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | Context::get()->getConfig()->set('working_path', '/foo'); |
| 145 | 145 | |
| 146 | 146 | try { |
| 147 | - within('/bar', function () { |
|
| 147 | + within('/bar', function() { |
|
| 148 | 148 | throw new \Exception('Dummy exception'); |
| 149 | 149 | }); |
| 150 | 150 | } catch (\Exception $exception) { |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | |
| 158 | 158 | public function testWithinReturningValue() |
| 159 | 159 | { |
| 160 | - $output = within('/foo', function () { |
|
| 160 | + $output = within('/foo', function() { |
|
| 161 | 161 | return 'bar'; |
| 162 | 162 | }); |
| 163 | 163 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | |
| 167 | 167 | public function testWithinWithVoidFunction() |
| 168 | 168 | { |
| 169 | - $output = within('/foo', function () { |
|
| 169 | + $output = within('/foo', function() { |
|
| 170 | 170 | // noop |
| 171 | 171 | }); |
| 172 | 172 | |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | |
| 176 | 176 | private function taskToNames($tasks) |
| 177 | 177 | { |
| 178 | - return array_map(function (Task $task) { |
|
| 178 | + return array_map(function(Task $task) { |
|
| 179 | 179 | return $task->getName(); |
| 180 | 180 | }, $tasks); |
| 181 | 181 | } |