@@ -32,7 +32,7 @@ |
||
32 | 32 | public function stream_write(string $data): int { |
33 | 33 | $left = substr($GLOBALS[$this->varname], 0, $this->position); |
34 | 34 | $right = substr($GLOBALS[$this->varname], $this->position + strlen($data)); |
35 | - $GLOBALS[$this->varname] = $left . $data . $right; |
|
35 | + $GLOBALS[$this->varname] = $left.$data.$right; |
|
36 | 36 | $this->position += strlen($data); |
37 | 37 | return strlen($data); |
38 | 38 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @return array |
45 | 45 | */ |
46 | 46 | public function exec($int, $bool, $foo, $test = 4, $test2 = 1) { |
47 | - $this->registerResponder('text', function ($in) { |
|
47 | + $this->registerResponder('text', function($in) { |
|
48 | 48 | return new JSONResponse(['text' => $in]); |
49 | 49 | }); |
50 | 50 | return [$int, $bool, $test, $test2]; |
@@ -289,12 +289,12 @@ discard block |
||
289 | 289 | ->method('beforeController'); |
290 | 290 | $this->middlewareDispatcher->expects($this->once()) |
291 | 291 | ->method('afterController') |
292 | - ->willReturnCallback(function ($a, $b, $in) { |
|
292 | + ->willReturnCallback(function($a, $b, $in) { |
|
293 | 293 | return $in; |
294 | 294 | }); |
295 | 295 | $this->middlewareDispatcher->expects($this->once()) |
296 | 296 | ->method('beforeOutput') |
297 | - ->willReturnCallback(function ($a, $b, $in) { |
|
297 | + ->willReturnCallback(function($a, $b, $in) { |
|
298 | 298 | return $in; |
299 | 299 | }); |
300 | 300 | } |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | public function testInjectFromServer(): void { |
52 | - $this->server->registerService(Interface1::class, function () { |
|
52 | + $this->server->registerService(Interface1::class, function() { |
|
53 | 53 | return new ClassA1(); |
54 | 54 | }); |
55 | 55 | |
56 | - $this->server->registerService(ClassB::class, function (SimpleContainer $c) { |
|
56 | + $this->server->registerService(ClassB::class, function(SimpleContainer $c) { |
|
57 | 57 | return new ClassB( |
58 | 58 | $c->query(Interface1::class) |
59 | 59 | ); |
@@ -65,11 +65,11 @@ discard block |
||
65 | 65 | } |
66 | 66 | |
67 | 67 | public function testInjectDepFromServer(): void { |
68 | - $this->server->registerService(Interface1::class, function () { |
|
68 | + $this->server->registerService(Interface1::class, function() { |
|
69 | 69 | return new ClassA1(); |
70 | 70 | }); |
71 | 71 | |
72 | - $this->container->registerService(ClassB::class, function (SimpleContainer $c) { |
|
72 | + $this->container->registerService(ClassB::class, function(SimpleContainer $c) { |
|
73 | 73 | return new ClassB( |
74 | 74 | $c->query(Interface1::class) |
75 | 75 | ); |
@@ -81,15 +81,15 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | public function testOverwriteDepFromServer(): void { |
84 | - $this->server->registerService(Interface1::class, function () { |
|
84 | + $this->server->registerService(Interface1::class, function() { |
|
85 | 85 | return new ClassA1(); |
86 | 86 | }); |
87 | 87 | |
88 | - $this->container->registerService(Interface1::class, function () { |
|
88 | + $this->container->registerService(Interface1::class, function() { |
|
89 | 89 | return new ClassA2(); |
90 | 90 | }); |
91 | 91 | |
92 | - $this->container->registerService(ClassB::class, function (SimpleContainer $c) { |
|
92 | + $this->container->registerService(ClassB::class, function(SimpleContainer $c) { |
|
93 | 93 | return new ClassB( |
94 | 94 | $c->query(Interface1::class) |
95 | 95 | ); |
@@ -101,15 +101,15 @@ discard block |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | public function testIgnoreOverwriteInServerClass(): void { |
104 | - $this->server->registerService(Interface1::class, function () { |
|
104 | + $this->server->registerService(Interface1::class, function() { |
|
105 | 105 | return new ClassA1(); |
106 | 106 | }); |
107 | 107 | |
108 | - $this->container->registerService(Interface1::class, function () { |
|
108 | + $this->container->registerService(Interface1::class, function() { |
|
109 | 109 | return new ClassA2(); |
110 | 110 | }); |
111 | 111 | |
112 | - $this->server->registerService(ClassB::class, function (SimpleContainer $c) { |
|
112 | + $this->server->registerService(ClassB::class, function(SimpleContainer $c) { |
|
113 | 113 | return new ClassB( |
114 | 114 | $c->query(Interface1::class) |
115 | 115 | ); |
@@ -113,7 +113,7 @@ |
||
113 | 113 | $hashSet = false; |
114 | 114 | $this->session |
115 | 115 | ->method('set') |
116 | - ->willReturnCallback(function ($key, $value) use (&$tokenSet, &$hashSet) { |
|
116 | + ->willReturnCallback(function($key, $value) use (&$tokenSet, &$hashSet) { |
|
117 | 117 | if ($key === 'public_link_authenticated_token' && $value === 'token') { |
118 | 118 | $tokenSet = true; |
119 | 119 | return true; |
@@ -20,13 +20,13 @@ |
||
20 | 20 | class ChildController extends Controller { |
21 | 21 | public function __construct($appName, $request) { |
22 | 22 | parent::__construct($appName, $request); |
23 | - $this->registerResponder('tom', function ($respone) { |
|
23 | + $this->registerResponder('tom', function($respone) { |
|
24 | 24 | return 'hi'; |
25 | 25 | }); |
26 | 26 | } |
27 | 27 | |
28 | 28 | public function custom($in) { |
29 | - $this->registerResponder('json', function ($response) { |
|
29 | + $this->registerResponder('json', function($response) { |
|
30 | 30 | return new JSONResponse([strlen($response)]); |
31 | 31 | }); |
32 | 32 |
@@ -19,8 +19,8 @@ |
||
19 | 19 | use Test\TestCase; |
20 | 20 | |
21 | 21 | class SessionMiddlewareTest extends TestCase { |
22 | - private ControllerMethodReflector|MockObject $reflector; |
|
23 | - private ISession|MockObject $session; |
|
22 | + private ControllerMethodReflector | MockObject $reflector; |
|
23 | + private ISession | MockObject $session; |
|
24 | 24 | private Controller $controller; |
25 | 25 | private SessionMiddleware $middleware; |
26 | 26 |
@@ -58,13 +58,13 @@ discard block |
||
58 | 58 | * @group DB |
59 | 59 | */ |
60 | 60 | class RateLimitingMiddlewareTest extends TestCase { |
61 | - private IRequest|MockObject $request; |
|
62 | - private IUserSession|MockObject $userSession; |
|
61 | + private IRequest | MockObject $request; |
|
62 | + private IUserSession | MockObject $userSession; |
|
63 | 63 | private ControllerMethodReflector $reflector; |
64 | - private Limiter|MockObject $limiter; |
|
65 | - private ISession|MockObject $session; |
|
66 | - private IAppConfig|MockObject $appConfig; |
|
67 | - private BruteforceAllowList|MockObject $bruteForceAllowList; |
|
64 | + private Limiter | MockObject $limiter; |
|
65 | + private ISession | MockObject $session; |
|
66 | + private IAppConfig | MockObject $appConfig; |
|
67 | + private BruteforceAllowList | MockObject $bruteForceAllowList; |
|
68 | 68 | private RateLimitingMiddleware $rateLimitingMiddleware; |
69 | 69 | |
70 | 70 | protected function setUp(): void { |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | $this->limiter |
144 | 144 | ->expects($this->once()) |
145 | 145 | ->method('registerAnonRequest') |
146 | - ->with(get_class($controller) . '::testMethodWithAnnotation', '10', '100', '127.0.0.1'); |
|
146 | + ->with(get_class($controller).'::testMethodWithAnnotation', '10', '100', '127.0.0.1'); |
|
147 | 147 | |
148 | 148 | $this->reflector->reflect($controller, 'testMethodWithAnnotation'); |
149 | 149 | $this->rateLimitingMiddleware->beforeController($controller, 'testMethodWithAnnotation'); |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $this->limiter |
170 | 170 | ->expects($this->once()) |
171 | 171 | ->method('registerUserRequest') |
172 | - ->with(get_class($controller) . '::testMethodWithAnnotation', '20', '200', $user); |
|
172 | + ->with(get_class($controller).'::testMethodWithAnnotation', '20', '200', $user); |
|
173 | 173 | |
174 | 174 | |
175 | 175 | $this->reflector->reflect($controller, 'testMethodWithAnnotation'); |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | $this->limiter |
196 | 196 | ->expects($this->once()) |
197 | 197 | ->method('registerAnonRequest') |
198 | - ->with(get_class($controller) . '::testMethodWithAnnotationFallback', '10', '100', '127.0.0.1'); |
|
198 | + ->with(get_class($controller).'::testMethodWithAnnotationFallback', '10', '100', '127.0.0.1'); |
|
199 | 199 | |
200 | 200 | $this->reflector->reflect($controller, 'testMethodWithAnnotationFallback'); |
201 | 201 | $this->rateLimitingMiddleware->beforeController($controller, 'testMethodWithAnnotationFallback'); |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | $this->limiter |
220 | 220 | ->expects($this->once()) |
221 | 221 | ->method('registerAnonRequest') |
222 | - ->with(get_class($controller) . '::testMethodWithAttributes', '10', '100', '127.0.0.1'); |
|
222 | + ->with(get_class($controller).'::testMethodWithAttributes', '10', '100', '127.0.0.1'); |
|
223 | 223 | |
224 | 224 | $this->reflector->reflect($controller, 'testMethodWithAttributes'); |
225 | 225 | $this->rateLimitingMiddleware->beforeController($controller, 'testMethodWithAttributes'); |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | $this->limiter |
246 | 246 | ->expects($this->once()) |
247 | 247 | ->method('registerUserRequest') |
248 | - ->with(get_class($controller) . '::testMethodWithAttributes', '20', '200', $user); |
|
248 | + ->with(get_class($controller).'::testMethodWithAttributes', '20', '200', $user); |
|
249 | 249 | |
250 | 250 | |
251 | 251 | $this->reflector->reflect($controller, 'testMethodWithAttributes'); |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | $this->limiter |
272 | 272 | ->expects($this->once()) |
273 | 273 | ->method('registerAnonRequest') |
274 | - ->with(get_class($controller) . '::testMethodWithAttributesFallback', '10', '100', '127.0.0.1'); |
|
274 | + ->with(get_class($controller).'::testMethodWithAttributesFallback', '10', '100', '127.0.0.1'); |
|
275 | 275 | |
276 | 276 | $this->reflector->reflect($controller, 'testMethodWithAttributesFallback'); |
277 | 277 | $this->rateLimitingMiddleware->beforeController($controller, 'testMethodWithAttributesFallback'); |
@@ -134,11 +134,11 @@ |
||
134 | 134 | $prefix = Server::get(IConfig::class)->getSystemValueString('dbtableprefix', 'oc_'); |
135 | 135 | $schema = $this->connection->createSchema(); |
136 | 136 | try { |
137 | - $schema->getTable($prefix . 'testing'); |
|
137 | + $schema->getTable($prefix.'testing'); |
|
138 | 138 | $this->connection->getQueryBuilder()->delete('testing')->executeStatement(); |
139 | 139 | } catch (SchemaException $e) { |
140 | 140 | $this->schemaSetup = true; |
141 | - $table = $schema->createTable($prefix . 'testing'); |
|
141 | + $table = $schema->createTable($prefix.'testing'); |
|
142 | 142 | $table->addColumn('id', Types::BIGINT, [ |
143 | 143 | 'autoincrement' => true, |
144 | 144 | 'notnull' => true, |
@@ -74,7 +74,7 @@ |
||
74 | 74 | public function testRegisterService(bool $shared): void { |
75 | 75 | $app = $this->createMock(App::class); |
76 | 76 | $service = 'abc'; |
77 | - $factory = function () { |
|
77 | + $factory = function() { |
|
78 | 78 | return 'def'; |
79 | 79 | }; |
80 | 80 | $container = $this->createMock(IAppContainer::class); |