@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | public function testWithClosure() |
| 30 | 30 | { |
| 31 | 31 | $pimple = new Container(); |
| 32 | - $pimple['service'] = function () { |
|
| 32 | + $pimple['service'] = function() { |
|
| 33 | 33 | return new Service(); |
| 34 | 34 | }; |
| 35 | 35 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | public function testServicesShouldBeDifferent() |
| 40 | 40 | { |
| 41 | 41 | $pimple = new Container(); |
| 42 | - $pimple['service'] = $pimple->factory(function () { |
|
| 42 | + $pimple['service'] = $pimple->factory(function() { |
|
| 43 | 43 | return new Service(); |
| 44 | 44 | }); |
| 45 | 45 | |
@@ -55,10 +55,10 @@ discard block |
||
| 55 | 55 | public function testShouldPassContainerAsParameter() |
| 56 | 56 | { |
| 57 | 57 | $pimple = new Container(); |
| 58 | - $pimple['service'] = function () { |
|
| 58 | + $pimple['service'] = function() { |
|
| 59 | 59 | return new Service(); |
| 60 | 60 | }; |
| 61 | - $pimple['container'] = function ($container) { |
|
| 61 | + $pimple['container'] = function($container) { |
|
| 62 | 62 | return $container; |
| 63 | 63 | }; |
| 64 | 64 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | { |
| 71 | 71 | $pimple = new Container(); |
| 72 | 72 | $pimple['param'] = 'value'; |
| 73 | - $pimple['service'] = function () { |
|
| 73 | + $pimple['service'] = function() { |
|
| 74 | 74 | return new Service(); |
| 75 | 75 | }; |
| 76 | 76 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | { |
| 123 | 123 | $pimple = new Container(); |
| 124 | 124 | $pimple['param'] = 'value'; |
| 125 | - $pimple['service'] = function () { |
|
| 125 | + $pimple['service'] = function() { |
|
| 126 | 126 | return new Service(); |
| 127 | 127 | }; |
| 128 | 128 | |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | public function testRaw() |
| 170 | 170 | { |
| 171 | 171 | $pimple = new Container(); |
| 172 | - $pimple['service'] = $definition = $pimple->factory(function () { |
|
| 172 | + $pimple['service'] = $definition = $pimple->factory(function() { |
|
| 173 | 173 | return 'foo'; |
| 174 | 174 | }); |
| 175 | 175 | $this->assertSame($definition, $pimple->raw('service')); |
@@ -209,10 +209,10 @@ discard block |
||
| 209 | 209 | public function testExtend($service) |
| 210 | 210 | { |
| 211 | 211 | $pimple = new Container(); |
| 212 | - $pimple['shared_service'] = function () { |
|
| 212 | + $pimple['shared_service'] = function() { |
|
| 213 | 213 | return new Service(); |
| 214 | 214 | }; |
| 215 | - $pimple['factory_service'] = $pimple->factory(function () { |
|
| 215 | + $pimple['factory_service'] = $pimple->factory(function() { |
|
| 216 | 216 | return new Service(); |
| 217 | 217 | }); |
| 218 | 218 | |
@@ -240,10 +240,10 @@ discard block |
||
| 240 | 240 | } |
| 241 | 241 | $pimple = new Container(); |
| 242 | 242 | |
| 243 | - $pimple['foo'] = $pimple->factory(function () { |
|
| 243 | + $pimple['foo'] = $pimple->factory(function() { |
|
| 244 | 244 | return; |
| 245 | 245 | }); |
| 246 | - $pimple['foo'] = $pimple->extend('foo', function ($foo, $pimple) { |
|
| 246 | + $pimple['foo'] = $pimple->extend('foo', function($foo, $pimple) { |
|
| 247 | 247 | return; |
| 248 | 248 | }); |
| 249 | 249 | unset($pimple['foo']); |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | $this->expectExceptionMessage('Identifier "foo" is not defined.'); |
| 264 | 264 | |
| 265 | 265 | $pimple = new Container(); |
| 266 | - $pimple->extend('foo', function () { |
|
| 266 | + $pimple->extend('foo', function() { |
|
| 267 | 267 | }); |
| 268 | 268 | } |
| 269 | 269 | |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | $this->expectExceptionMessage('Identifier "foo" is not defined.'); |
| 277 | 277 | |
| 278 | 278 | $pimple = new Container(); |
| 279 | - $pimple->extend('foo', function () { |
|
| 279 | + $pimple->extend('foo', function() { |
|
| 280 | 280 | }); |
| 281 | 281 | } |
| 282 | 282 | |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | |
| 360 | 360 | $pimple = new Container(); |
| 361 | 361 | $pimple['foo'] = $service; |
| 362 | - $pimple->extend('foo', function () { |
|
| 362 | + $pimple->extend('foo', function() { |
|
| 363 | 363 | }); |
| 364 | 364 | } |
| 365 | 365 | |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | |
| 375 | 375 | $pimple = new Container(); |
| 376 | 376 | $pimple['foo'] = $service; |
| 377 | - $pimple->extend('foo', function () { |
|
| 377 | + $pimple->extend('foo', function() { |
|
| 378 | 378 | }); |
| 379 | 379 | } |
| 380 | 380 | |
@@ -385,11 +385,11 @@ discard block |
||
| 385 | 385 | public function testExtendingProtectedClosureDeprecation() |
| 386 | 386 | { |
| 387 | 387 | $pimple = new Container(); |
| 388 | - $pimple['foo'] = $pimple->protect(function () { |
|
| 388 | + $pimple['foo'] = $pimple->protect(function() { |
|
| 389 | 389 | return 'bar'; |
| 390 | 390 | }); |
| 391 | 391 | |
| 392 | - $pimple->extend('foo', function ($value) { |
|
| 392 | + $pimple->extend('foo', function($value) { |
|
| 393 | 393 | return $value . '-baz'; |
| 394 | 394 | }); |
| 395 | 395 | |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | { |
| 404 | 404 | $this->expectException(\TypeError::class); |
| 405 | 405 | $pimple = new Container(); |
| 406 | - $pimple['foo'] = function () { |
|
| 406 | + $pimple['foo'] = function() { |
|
| 407 | 407 | }; |
| 408 | 408 | $pimple->extend('foo', $service); |
| 409 | 409 | } |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | { |
| 417 | 417 | $this->expectException(\TypeError::class); |
| 418 | 418 | $pimple = new Container(); |
| 419 | - $pimple['foo'] = function () { |
|
| 419 | + $pimple['foo'] = function() { |
|
| 420 | 420 | }; |
| 421 | 421 | $pimple->extend('foo', $service); |
| 422 | 422 | } |
@@ -427,12 +427,12 @@ discard block |
||
| 427 | 427 | $this->expectExceptionMessage('Cannot override frozen service "foo".'); |
| 428 | 428 | |
| 429 | 429 | $pimple = new Container(); |
| 430 | - $pimple['foo'] = function () { |
|
| 430 | + $pimple['foo'] = function() { |
|
| 431 | 431 | return new NonInvokable(); |
| 432 | 432 | }; |
| 433 | 433 | $foo = $pimple['foo']; |
| 434 | 434 | |
| 435 | - $pimple->extend('foo', function () { |
|
| 435 | + $pimple->extend('foo', function() { |
|
| 436 | 436 | }); |
| 437 | 437 | } |
| 438 | 438 | |
@@ -442,12 +442,12 @@ discard block |
||
| 442 | 442 | $this->expectExceptionMessage('Cannot override frozen service "foo".'); |
| 443 | 443 | |
| 444 | 444 | $pimple = new Container(); |
| 445 | - $pimple['foo'] = function () { |
|
| 445 | + $pimple['foo'] = function() { |
|
| 446 | 446 | return new Invokable(); |
| 447 | 447 | }; |
| 448 | 448 | $foo = $pimple['foo']; |
| 449 | 449 | |
| 450 | - $pimple->extend('foo', function () { |
|
| 450 | + $pimple->extend('foo', function() { |
|
| 451 | 451 | }); |
| 452 | 452 | } |
| 453 | 453 | |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | public static function serviceDefinitionProvider() |
| 469 | 469 | { |
| 470 | 470 | return [ |
| 471 | - [function ($value) { |
|
| 471 | + [function($value) { |
|
| 472 | 472 | $service = new Service(); |
| 473 | 473 | $service->value = $value; |
| 474 | 474 | |
@@ -481,12 +481,12 @@ discard block |
||
| 481 | 481 | public function testDefiningNewServiceAfterFreeze() |
| 482 | 482 | { |
| 483 | 483 | $pimple = new Container(); |
| 484 | - $pimple['foo'] = function () { |
|
| 484 | + $pimple['foo'] = function() { |
|
| 485 | 485 | return 'foo'; |
| 486 | 486 | }; |
| 487 | 487 | $foo = $pimple['foo']; |
| 488 | 488 | |
| 489 | - $pimple['bar'] = function () { |
|
| 489 | + $pimple['bar'] = function() { |
|
| 490 | 490 | return 'bar'; |
| 491 | 491 | }; |
| 492 | 492 | $this->assertSame('bar', $pimple['bar']); |
@@ -498,12 +498,12 @@ discard block |
||
| 498 | 498 | $this->expectExceptionMessage('Cannot override frozen service "foo".'); |
| 499 | 499 | |
| 500 | 500 | $pimple = new Container(); |
| 501 | - $pimple['foo'] = function () { |
|
| 501 | + $pimple['foo'] = function() { |
|
| 502 | 502 | return 'foo'; |
| 503 | 503 | }; |
| 504 | 504 | $foo = $pimple['foo']; |
| 505 | 505 | |
| 506 | - $pimple['foo'] = function () { |
|
| 506 | + $pimple['foo'] = function() { |
|
| 507 | 507 | return 'bar'; |
| 508 | 508 | }; |
| 509 | 509 | } |
@@ -517,12 +517,12 @@ discard block |
||
| 517 | 517 | $this->expectExceptionMessage('Cannot override frozen service "foo".'); |
| 518 | 518 | |
| 519 | 519 | $pimple = new Container(); |
| 520 | - $pimple['foo'] = function () { |
|
| 520 | + $pimple['foo'] = function() { |
|
| 521 | 521 | return 'foo'; |
| 522 | 522 | }; |
| 523 | 523 | $foo = $pimple['foo']; |
| 524 | 524 | |
| 525 | - $pimple['foo'] = function () { |
|
| 525 | + $pimple['foo'] = function() { |
|
| 526 | 526 | return 'bar'; |
| 527 | 527 | }; |
| 528 | 528 | } |
@@ -530,13 +530,13 @@ discard block |
||
| 530 | 530 | public function testRemovingServiceAfterFreeze() |
| 531 | 531 | { |
| 532 | 532 | $pimple = new Container(); |
| 533 | - $pimple['foo'] = function () { |
|
| 533 | + $pimple['foo'] = function() { |
|
| 534 | 534 | return 'foo'; |
| 535 | 535 | }; |
| 536 | 536 | $foo = $pimple['foo']; |
| 537 | 537 | |
| 538 | 538 | unset($pimple['foo']); |
| 539 | - $pimple['foo'] = function () { |
|
| 539 | + $pimple['foo'] = function() { |
|
| 540 | 540 | return 'bar'; |
| 541 | 541 | }; |
| 542 | 542 | $this->assertSame('bar', $pimple['foo']); |
@@ -545,13 +545,13 @@ discard block |
||
| 545 | 545 | public function testExtendingService() |
| 546 | 546 | { |
| 547 | 547 | $pimple = new Container(); |
| 548 | - $pimple['foo'] = function () { |
|
| 548 | + $pimple['foo'] = function() { |
|
| 549 | 549 | return 'foo'; |
| 550 | 550 | }; |
| 551 | - $pimple['foo'] = $pimple->extend('foo', function ($foo, $app) { |
|
| 551 | + $pimple['foo'] = $pimple->extend('foo', function($foo, $app) { |
|
| 552 | 552 | return "$foo.bar"; |
| 553 | 553 | }); |
| 554 | - $pimple['foo'] = $pimple->extend('foo', function ($foo, $app) { |
|
| 554 | + $pimple['foo'] = $pimple->extend('foo', function($foo, $app) { |
|
| 555 | 555 | return "$foo.baz"; |
| 556 | 556 | }); |
| 557 | 557 | $this->assertSame('foo.bar.baz', $pimple['foo']); |
@@ -560,15 +560,15 @@ discard block |
||
| 560 | 560 | public function testExtendingServiceAfterOtherServiceFreeze() |
| 561 | 561 | { |
| 562 | 562 | $pimple = new Container(); |
| 563 | - $pimple['foo'] = function () { |
|
| 563 | + $pimple['foo'] = function() { |
|
| 564 | 564 | return 'foo'; |
| 565 | 565 | }; |
| 566 | - $pimple['bar'] = function () { |
|
| 566 | + $pimple['bar'] = function() { |
|
| 567 | 567 | return 'bar'; |
| 568 | 568 | }; |
| 569 | 569 | $foo = $pimple['foo']; |
| 570 | 570 | |
| 571 | - $pimple['bar'] = $pimple->extend('bar', function ($bar, $app) { |
|
| 571 | + $pimple['bar'] = $pimple->extend('bar', function($bar, $app) { |
|
| 572 | 572 | return "$bar.baz"; |
| 573 | 573 | }); |
| 574 | 574 | $this->assertSame('bar.baz', $pimple['bar']); |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | $group->select('role=prod'); |
| 75 | 75 | self::assertEquals([$a, $b], $scriptManager->getTasks('group')); |
| 76 | 76 | self::assertEquals([[['=', 'role', 'prod']]], $a->getSelector()); |
| 77 | - self::assertEquals([[['=', 'stage', 'beta']],[['=', 'role', 'prod']]], $b->getSelector()); |
|
| 77 | + self::assertEquals([[['=', 'stage', 'beta']], [['=', 'role', 'prod']]], $b->getSelector()); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | public function testThrowsExceptionIfTaskCollectionEmpty() |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | ->expects(self::exactly(1)) |
| 29 | 29 | ->method('callback'); |
| 30 | 30 | |
| 31 | - $task = new Task('task_name', function () use ($mock) { |
|
| 31 | + $task = new Task('task_name', function() use ($mock) { |
|
| 32 | 32 | $mock->callback(); |
| 33 | 33 | }); |
| 34 | 34 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | $mock2 |
| 74 | 74 | ->expects(self::once()) |
| 75 | 75 | ->method('callback'); |
| 76 | - $task2 = new Task('task2', function () use ($mock2) { |
|
| 76 | + $task2 = new Task('task2', function() use ($mock2) { |
|
| 77 | 77 | $mock2->callback(); |
| 78 | 78 | }); |
| 79 | 79 | $task2->run($context); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | task('bar', $spy); |
| 93 | 93 | task('group', ['foo', 'bar']); |
| 94 | 94 | |
| 95 | - (new Task('group:invoke', function () { |
|
| 95 | + (new Task('group:invoke', function() { |
|
| 96 | 96 | invoke('group'); |
| 97 | 97 | }))->run(new Context(new Host('localhost'))); |
| 98 | 98 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | { |
| 29 | 29 | $config = new Configuration(); |
| 30 | 30 | $config->set('opt', true); |
| 31 | - $config->set('fn', function () { |
|
| 31 | + $config->set('fn', function() { |
|
| 32 | 32 | return 'func'; |
| 33 | 33 | }); |
| 34 | 34 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | public function testGetFromCallback() |
| 104 | 104 | { |
| 105 | 105 | $config = new Configuration(); |
| 106 | - $config->set('func', function () { |
|
| 106 | + $config->set('func', function() { |
|
| 107 | 107 | return 'param'; |
| 108 | 108 | }); |
| 109 | 109 | self::assertEquals('param', $config['func']); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | $parent = new Configuration(); |
| 151 | 151 | $alpha = new Configuration($parent); |
| 152 | 152 | |
| 153 | - $parent->set('files', function () { |
|
| 153 | + $parent->set('files', function() { |
|
| 154 | 154 | return ['a', 'b']; |
| 155 | 155 | }); |
| 156 | 156 | $alpha->add('files', ['c']); |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $alpha = new Configuration($parent); |
| 165 | 165 | |
| 166 | 166 | $parent->set('global', 'do not include'); |
| 167 | - $alpha->set('whoami', function () { |
|
| 167 | + $alpha->set('whoami', function() { |
|
| 168 | 168 | $this->fail('should not be called'); |
| 169 | 169 | }); |
| 170 | 170 | $alpha->set('name', 'alpha'); |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | // we need to user require instead of require_once, as the hosts HAVE to be loaded multiple times |
| 6 | 6 | require_once __DIR__ . '/hosts.php'; |
| 7 | 7 | |
| 8 | -task('test:functions:run-with-placeholders', function (): void { |
|
| 8 | +task('test:functions:run-with-placeholders', function(): void { |
|
| 9 | 9 | $cmd = 'echo "placeholder $foo $baz"'; |
| 10 | 10 | $env = ['foo' => '{{bar}}', 'baz' => 'xyz%']; |
| 11 | 11 | |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | // we need to user require instead of require_once, as the hosts HAVE to be loaded multiple times |
| 5 | 5 | require_once __DIR__ . '/hosts.php'; |
| 6 | 6 | |
| 7 | -task('test:misc:sudo-write-user', function (): void { |
|
| 7 | +task('test:misc:sudo-write-user', function(): void { |
|
| 8 | 8 | $cmd = 'sudo bash -c \'echo Current user is: $USER\''; |
| 9 | 9 | $output = run($cmd); |
| 10 | 10 | writeln($output); |
@@ -7,9 +7,9 @@ |
||
| 7 | 7 | |
| 8 | 8 | require_once __DIR__ . '/hosts.php'; |
| 9 | 9 | |
| 10 | -task('test:timeouts', function () { |
|
| 10 | +task('test:timeouts', function() { |
|
| 11 | 11 | try { |
| 12 | - run("php -r 'while(true){}'", [ 'timeout' => 1 ] ); |
|
| 12 | + run("php -r 'while(true){}'", ['timeout' => 1]); |
|
| 13 | 13 | } catch (TimeoutException $e) { |
| 14 | 14 | $ps = run("if ps aux | grep '[p]hp -r while(true){}'; then echo still running; else echo +timeout; fi"); |
| 15 | 15 | if ($ps != '+timeout') { |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | $stream = fopen('php://memory', 'r+', false); |
| 25 | 25 | |
| 26 | 26 | foreach ($inputs as $input) { |
| 27 | - fwrite($stream, $input.\PHP_EOL); |
|
| 27 | + fwrite($stream, $input . \PHP_EOL); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | rewind($stream); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | private function generateCommand(array $arguments): array |
| 36 | 36 | { |
| 37 | - $arguments = array_merge([ $this->binaryPath ], $arguments); |
|
| 37 | + $arguments = array_merge([$this->binaryPath], $arguments); |
|
| 38 | 38 | |
| 39 | 39 | $outputArgs = []; |
| 40 | 40 | foreach ($arguments as $key => $value) { |
@@ -6,8 +6,8 @@ |
||
| 6 | 6 | localhost('beta')->setLabels(['env' => 'dev']); |
| 7 | 7 | localhost('dev')->setLabels(['env' => 'dev']); |
| 8 | 8 | |
| 9 | -task('test', function () { |
|
| 10 | - on(select('env=dev'), function () { |
|
| 9 | +task('test', function() { |
|
| 10 | + on(select('env=dev'), function() { |
|
| 11 | 11 | info('executing on {{alias}}'); |
| 12 | 12 | }); |
| 13 | 13 | }); |