@@ -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 | |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | { |
| 25 | 25 | $i = new Injector(); |
| 26 | 26 | |
| 27 | - $filename = __DIR__ . '/Fixtures/TestClass.php'; |
|
| 27 | + $filename = __DIR__.'/Fixtures/TestClass.php'; |
|
| 28 | 28 | $r = $i->injectDependencies( |
| 29 | 29 | file_get_contents($filename), |
| 30 | 30 | $this->getDefinition( |
@@ -37,16 +37,16 @@ discard block |
||
| 37 | 37 | ) |
| 38 | 38 | ); |
| 39 | 39 | |
| 40 | - $this->assertStringContainsString(Fixtures\Some::class . ';', $r); |
|
| 40 | + $this->assertStringContainsString(Fixtures\Some::class.';', $r); |
|
| 41 | 41 | $this->assertRegExp('/@var Some[\s|\r\n]/', $r); |
| 42 | 42 | $this->assertStringContainsString('@param Some $test', $r); |
| 43 | 43 | |
| 44 | - $this->assertStringContainsString(Fixtures\SubFolder\Some::class . ' as Some2;', $r); |
|
| 45 | - $this->assertStringNotContainsString(Fixtures\SubFolder\Some::class . ';', $r); |
|
| 44 | + $this->assertStringContainsString(Fixtures\SubFolder\Some::class.' as Some2;', $r); |
|
| 45 | + $this->assertStringNotContainsString(Fixtures\SubFolder\Some::class.';', $r); |
|
| 46 | 46 | $this->assertRegExp('/@var Some2[\s|\r\n]/', $r); |
| 47 | 47 | $this->assertStringContainsString('@param Some2 $test2', $r); |
| 48 | 48 | |
| 49 | - $this->assertStringContainsString(Fixtures\ATest3::class . ';', $r); |
|
| 49 | + $this->assertStringContainsString(Fixtures\ATest3::class.';', $r); |
|
| 50 | 50 | $this->assertRegExp('/@var ATest3[\s|\r\n]/', $r); |
| 51 | 51 | $this->assertStringContainsString('@param ATest3 $test3', $r); |
| 52 | 52 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | { |
| 59 | 59 | $i = new Injector(); |
| 60 | 60 | |
| 61 | - $filename = __DIR__ . '/Fixtures/TestClassWithImports.php'; |
|
| 61 | + $filename = __DIR__.'/Fixtures/TestClassWithImports.php'; |
|
| 62 | 62 | $r = $i->injectDependencies( |
| 63 | 63 | file_get_contents($filename), |
| 64 | 64 | $this->getDefinition( |
@@ -71,18 +71,18 @@ discard block |
||
| 71 | 71 | ) |
| 72 | 72 | ); |
| 73 | 73 | |
| 74 | - $this->assertStringContainsString(Fixtures\Some::class . ' as FTest;', $r); |
|
| 75 | - $this->assertStringNotContainsString(Fixtures\Some::class . ';', $r); |
|
| 74 | + $this->assertStringContainsString(Fixtures\Some::class.' as FTest;', $r); |
|
| 75 | + $this->assertStringNotContainsString(Fixtures\Some::class.';', $r); |
|
| 76 | 76 | $this->assertRegExp('/@var FTest[\s|\r\n]/', $r); |
| 77 | 77 | $this->assertStringContainsString('@param FTest $test', $r); |
| 78 | 78 | |
| 79 | - $this->assertStringContainsString(Fixtures\SubFolder\Some::class . ' as TestAlias;', $r); |
|
| 80 | - $this->assertStringNotContainsString(Fixtures\SubFolder\Some::class . ';', $r); |
|
| 79 | + $this->assertStringContainsString(Fixtures\SubFolder\Some::class.' as TestAlias;', $r); |
|
| 80 | + $this->assertStringNotContainsString(Fixtures\SubFolder\Some::class.';', $r); |
|
| 81 | 81 | $this->assertRegExp('/@var TestAlias[\s|\r\n]/', $r); |
| 82 | 82 | $this->assertStringContainsString('@param TestAlias $test2', $r); |
| 83 | 83 | |
| 84 | - $this->assertStringContainsString(Fixtures\ATest3::class . ' as ATest;', $r); |
|
| 85 | - $this->assertStringNotContainsString(Fixtures\ATest3::class . ';', $r); |
|
| 84 | + $this->assertStringContainsString(Fixtures\ATest3::class.' as ATest;', $r); |
|
| 85 | + $this->assertStringNotContainsString(Fixtures\ATest3::class.';', $r); |
|
| 86 | 86 | $this->assertRegExp('/@var ATest[\s|\r\n]/', $r); |
| 87 | 87 | $this->assertStringContainsString('@param ATest $test3', $r); |
| 88 | 88 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | { |
| 95 | 95 | $i = new Injector(); |
| 96 | 96 | |
| 97 | - $filename = __DIR__ . '/Fixtures/ChildClass.php'; |
|
| 97 | + $filename = __DIR__.'/Fixtures/ChildClass.php'; |
|
| 98 | 98 | $r = $i->injectDependencies( |
| 99 | 99 | file_get_contents($filename), |
| 100 | 100 | $this->getDefinition( |
@@ -107,17 +107,17 @@ discard block |
||
| 107 | 107 | ) |
| 108 | 108 | ); |
| 109 | 109 | |
| 110 | - $this->assertStringContainsString(Fixtures\Some::class . ';', $r); |
|
| 110 | + $this->assertStringContainsString(Fixtures\Some::class.';', $r); |
|
| 111 | 111 | $this->assertRegExp('/@var Some[\s|\r\n]/', $r); |
| 112 | 112 | $this->assertStringContainsString('@param Some $test', $r); |
| 113 | 113 | |
| 114 | - $this->assertStringContainsString(Fixtures\SubFolder\Some::class . ' as Some2;', $r); |
|
| 115 | - $this->assertStringNotContainsString(Fixtures\SubFolder\Some::class . ';', $r); |
|
| 114 | + $this->assertStringContainsString(Fixtures\SubFolder\Some::class.' as Some2;', $r); |
|
| 115 | + $this->assertStringNotContainsString(Fixtures\SubFolder\Some::class.';', $r); |
|
| 116 | 116 | $this->assertRegExp('/@var Some2[\s|\r\n]/', $r); |
| 117 | 117 | $this->assertStringContainsString('@param Some2 $test2', $r); |
| 118 | 118 | |
| 119 | - $this->assertStringContainsString(Fixtures\ATest3::class . ' as ATestAlias;', $r); |
|
| 120 | - $this->assertStringNotContainsString(Fixtures\ATest3::class . ';', $r); |
|
| 119 | + $this->assertStringContainsString(Fixtures\ATest3::class.' as ATestAlias;', $r); |
|
| 120 | + $this->assertStringNotContainsString(Fixtures\ATest3::class.';', $r); |
|
| 121 | 121 | $this->assertRegExp('/@var ATestAlias[\s|\r\n]/', $r); |
| 122 | 122 | $this->assertStringContainsString('@param ATestAlias $test3', $r); |
| 123 | 123 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | { |
| 127 | 127 | $i = new Injector(); |
| 128 | 128 | |
| 129 | - $filename = __DIR__ . '/Fixtures/DuplicatePropertyClass.php'; |
|
| 129 | + $filename = __DIR__.'/Fixtures/DuplicatePropertyClass.php'; |
|
| 130 | 130 | $r = $i->injectDependencies( |
| 131 | 131 | file_get_contents($filename), |
| 132 | 132 | $this->getDefinition( |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | ) |
| 138 | 138 | ); |
| 139 | 139 | |
| 140 | - $this->assertStringContainsString(Fixtures\Some::class . ';', $r); |
|
| 140 | + $this->assertStringContainsString(Fixtures\Some::class.';', $r); |
|
| 141 | 141 | $this->assertRegExp('/@var Some[\s|\r\n]/', $r); |
| 142 | 142 | $this->assertStringContainsString('@param Some $test', $r); |
| 143 | 143 | $this->assertStringContainsString('__construct(Some $test)', $r); |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | final class AttributeMapperTest extends BaseTestCase |
| 24 | 24 | { |
| 25 | - private m\LegacyMockInterface|m\MockInterface|FilterProviderInterface $provider; |
|
| 25 | + private m\LegacyMockInterface | m\MockInterface | FilterProviderInterface $provider; |
|
| 26 | 26 | private AttributeMapper $mapper; |
| 27 | 27 | |
| 28 | 28 | public function setUp(): void |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | ->andReturn(['first' => ['foo' => 'bar'], 'second' => ['foo' => 'baz']]); |
| 70 | 70 | |
| 71 | 71 | [$schema, $errors] = $this->mapper->map( |
| 72 | - $filter = new class implements FilterInterface { |
|
| 72 | + $filter = new class implements FilterInterface{ |
|
| 73 | 73 | #[Post] |
| 74 | 74 | public string $username; |
| 75 | 75 | |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | ->andReturn(['first' => ['foo' => 'bar'], 'second' => ['foo' => 'baz']]); |
| 166 | 166 | |
| 167 | 167 | [$schema, $errors] = $this->mapper->map( |
| 168 | - $filter = new class implements FilterInterface { |
|
| 168 | + $filter = new class implements FilterInterface{ |
|
| 169 | 169 | #[Post] |
| 170 | 170 | public string $username; |
| 171 | 171 | |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | |
| 17 | 17 | final class InputMapperTest extends BaseTestCase |
| 18 | 18 | { |
| 19 | - private m\LegacyMockInterface|m\MockInterface|FilterProviderInterface $provider; |
|
| 19 | + private m\LegacyMockInterface | m\MockInterface | FilterProviderInterface $provider; |
|
| 20 | 20 | private InputMapper $mapper; |
| 21 | 21 | |
| 22 | 22 | public function setUp(): void |