@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | $this->assertSame(302, $response->getStatusCode()); |
| 59 | 59 | $this->assertSame(['Location' => ['/login']], $response->getHeaders()); |
| 60 | - $this->assertSame('', (string) $response->getBody()); |
|
| 60 | + $this->assertSame('', (string)$response->getBody()); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | #[DataProvider('failTokensDataProvider')] |
@@ -80,6 +80,6 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | $this->assertSame(301, $response->getStatusCode()); |
| 82 | 82 | $this->assertSame(['Location' => ['/login']], $response->getHeaders()); |
| 83 | - $this->assertSame('', (string) $response->getBody()); |
|
| 83 | + $this->assertSame('', (string)$response->getBody()); |
|
| 84 | 84 | } |
| 85 | 85 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | #[DataProvider('listenersDataProvider')] |
| 22 | 22 | public function testProcess(array $listener, array $args): void |
| 23 | 23 | { |
| 24 | - $registry = new class() implements ListenerRegistryInterface { |
|
| 24 | + $registry = new class() implements ListenerRegistryInterface{ |
|
| 25 | 25 | |
| 26 | 26 | public string $event; |
| 27 | 27 | public \Closure $listener; |
@@ -21,7 +21,8 @@ |
||
| 21 | 21 | #[DataProvider('listenersDataProvider')] |
| 22 | 22 | public function testProcess(array $listener, array $args): void |
| 23 | 23 | { |
| 24 | - $registry = new class() implements ListenerRegistryInterface { |
|
| 24 | + $registry = new class() implements ListenerRegistryInterface |
|
| 25 | + { |
|
| 25 | 26 | |
| 26 | 27 | public string $event; |
| 27 | 28 | public \Closure $listener; |
@@ -23,7 +23,8 @@ discard block |
||
| 23 | 23 | $root = new Container(); |
| 24 | 24 | $root->bind('foo', SampleClass::class); |
| 25 | 25 | |
| 26 | - $root->scope(function (ContainerInterface $c1) { |
|
| 26 | + $root->scope(function (ContainerInterface $c1) |
|
| 27 | + { |
|
| 27 | 28 | $c1->get('foo'); |
| 28 | 29 | }, bindings: ['foo' => SampleClass::class]); |
| 29 | 30 | |
@@ -54,7 +55,8 @@ discard block |
||
| 54 | 55 | { |
| 55 | 56 | $root = new Container(); |
| 56 | 57 | |
| 57 | - $root->scope(function (ContainerInterface $c1) use ($theSame, $alias) { |
|
| 58 | + $root->scope(function (ContainerInterface $c1) use ($theSame, $alias) |
|
| 59 | + { |
|
| 58 | 60 | $obj1 = $c1->get($alias); |
| 59 | 61 | $obj2 = $c1->get($alias); |
| 60 | 62 | |
@@ -79,14 +81,16 @@ discard block |
||
| 79 | 81 | { |
| 80 | 82 | $root = new Container(); |
| 81 | 83 | |
| 82 | - $root->scope(function (ContainerInterface $c1) use ($root) { |
|
| 84 | + $root->scope(function (ContainerInterface $c1) use ($root) |
|
| 85 | + { |
|
| 83 | 86 | $obj1 = $c1->get('foo'); |
| 84 | 87 | $this->weakMap->offsetSet($obj1, true); |
| 85 | 88 | |
| 86 | 89 | self::assertNotSame($root, $c1); |
| 87 | 90 | self::assertInstanceOf(stdClass::class, $obj1); |
| 88 | 91 | |
| 89 | - $c1->scope(function (ContainerInterface $c2) use ($root, $c1, $obj1) { |
|
| 92 | + $c1->scope(function (ContainerInterface $c2) use ($root, $c1, $obj1) |
|
| 93 | + { |
|
| 90 | 94 | $obj2 = $c2->get('foo'); |
| 91 | 95 | $this->weakMap->offsetSet($obj2, true); |
| 92 | 96 | |
@@ -115,14 +119,16 @@ discard block |
||
| 115 | 119 | $root->bindSingleton('bar', [Factory::class, 'makeStdClass']); |
| 116 | 120 | $root->bind(stdClass::class, new stdClass()); |
| 117 | 121 | |
| 118 | - $root->scope(function (ContainerInterface $c1) use ($root) { |
|
| 122 | + $root->scope(function (ContainerInterface $c1) use ($root) |
|
| 123 | + { |
|
| 119 | 124 | $obj1 = $c1->get('foo'); |
| 120 | 125 | $this->weakMap->offsetSet($obj1, true); |
| 121 | 126 | |
| 122 | 127 | self::assertInstanceOf(stdClass::class, $obj1); |
| 123 | 128 | // Singleton must be the same |
| 124 | 129 | self::assertSame($c1->get('bar'), $root->get('bar')); |
| 125 | - $c1->scope(function (ContainerInterface $c2) use ($root, $obj1) { |
|
| 130 | + $c1->scope(function (ContainerInterface $c2) use ($root, $obj1) |
|
| 131 | + { |
|
| 126 | 132 | $obj2 = $c2->get('foo'); |
| 127 | 133 | |
| 128 | 134 | self::assertInstanceOf(stdClass::class, $obj2); |
@@ -88,7 +88,8 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | public function testClosureFactory(): void |
| 90 | 90 | { |
| 91 | - $this->bind(Bucket::class, function ($data) { |
|
| 91 | + $this->bind(Bucket::class, function ($data) |
|
| 92 | + { |
|
| 92 | 93 | return new Bucket('via-closure', $data); |
| 93 | 94 | }); |
| 94 | 95 | |
@@ -128,7 +129,8 @@ discard block |
||
| 128 | 129 | $sample = new SampleClass(); |
| 129 | 130 | |
| 130 | 131 | $this->bind(Bucket::class, [Factory::class, 'makeBucketWithSample']); |
| 131 | - $this->bind(SampleClass::class, function () use ($sample) { |
|
| 132 | + $this->bind(SampleClass::class, function () use ($sample) |
|
| 133 | + { |
|
| 132 | 134 | return $sample; |
| 133 | 135 | }); |
| 134 | 136 | |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | public function testAllows(): void |
| 41 | 41 | { |
| 42 | 42 | $this->permission->method('hasRole') |
| 43 | - ->willReturnCallback(function (...$args) { |
|
| 43 | + ->willReturnCallback(function (...$args){ |
|
| 44 | 44 | static $series = [ |
| 45 | 45 | [['user'], false], |
| 46 | 46 | [['admin'], true], |
@@ -40,7 +40,8 @@ |
||
| 40 | 40 | public function testAllows(): void |
| 41 | 41 | { |
| 42 | 42 | $this->permission->method('hasRole') |
| 43 | - ->willReturnCallback(function (...$args) { |
|
| 43 | + ->willReturnCallback(function (...$args) |
|
| 44 | + { |
|
| 44 | 45 | static $series = [ |
| 45 | 46 | [['user'], false], |
| 46 | 47 | [['admin'], true], |
@@ -78,7 +78,8 @@ |
||
| 78 | 78 | |
| 79 | 79 | $this->rules->method('has')->willReturn(true); |
| 80 | 80 | $this->rules->method('get') |
| 81 | - ->willReturnCallback(function (...$args) use (&$series) { |
|
| 81 | + ->willReturnCallback(function (...$args) use (&$series) |
|
| 82 | + { |
|
| 82 | 83 | [$expectedArgs, $return] = \array_shift($series); |
| 83 | 84 | self::assertSame($expectedArgs, $args); |
| 84 | 85 | |