@@ -53,35 +53,35 @@ |
||
| 53 | 53 | public static function providerTestConcatString(): array { |
| 54 | 54 | return [ |
| 55 | 55 | '1 column: string param unicode' |
| 56 | - => [function ($q) { |
|
| 56 | + => [function($q) { |
|
| 57 | 57 | return [false, [$q->createNamedParameter(' |
@@ -48,15 +48,15 @@ discard block |
||
| 48 | 48 | $time = 1416916800; // Use a fixed timestamp so we don't switch days/years with the getTimestampAgo |
| 49 | 49 | $deL10N = Util::getL10N('lib', 'de'); |
| 50 | 50 | return [ |
| 51 | - ['seconds ago', $time, $time], |
|
| 52 | - ['in a few seconds', $time + 5 , $time], |
|
| 53 | - ['1 minute ago', self::getTimestampAgo($time, 30, 1), $time], |
|
| 54 | - ['15 minutes ago', self::getTimestampAgo($time, 30, 15), $time], |
|
| 55 | - ['in 15 minutes', $time, self::getTimestampAgo($time, 30, 15)], |
|
| 56 | - ['1 hour ago', self::getTimestampAgo($time, 30, 15, 1), $time], |
|
| 57 | - ['3 hours ago', self::getTimestampAgo($time, 30, 15, 3), $time], |
|
| 58 | - ['in 3 hours', $time, self::getTimestampAgo($time, 30, 15, 3)], |
|
| 59 | - ['4 days ago', self::getTimestampAgo($time, 30, 15, 3, 4), $time], |
|
| 51 | + ['seconds ago', $time, $time], |
|
| 52 | + ['in a few seconds', $time + 5, $time], |
|
| 53 | + ['1 minute ago', self::getTimestampAgo($time, 30, 1), $time], |
|
| 54 | + ['15 minutes ago', self::getTimestampAgo($time, 30, 15), $time], |
|
| 55 | + ['in 15 minutes', $time, self::getTimestampAgo($time, 30, 15)], |
|
| 56 | + ['1 hour ago', self::getTimestampAgo($time, 30, 15, 1), $time], |
|
| 57 | + ['3 hours ago', self::getTimestampAgo($time, 30, 15, 3), $time], |
|
| 58 | + ['in 3 hours', $time, self::getTimestampAgo($time, 30, 15, 3)], |
|
| 59 | + ['4 days ago', self::getTimestampAgo($time, 30, 15, 3, 4), $time], |
|
| 60 | 60 | |
| 61 | 61 | ['seconds ago', new \DateTime('Wed, 02 Oct 2013 23:59:58 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')], |
| 62 | 62 | ['seconds ago', new \DateTime('Wed, 02 Oct 2013 23:59:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000')], |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | #[\PHPUnit\Framework\Attributes\DataProvider('formatTimeSpanData')] |
| 82 | 82 | public function testFormatTimeSpan($expected, $timestamp, $compare, $locale = null): void { |
| 83 | - $this->assertEquals((string)$expected, (string)$this->formatter->formatTimeSpan($timestamp, $compare, $locale)); |
|
| 83 | + $this->assertEquals((string) $expected, (string) $this->formatter->formatTimeSpan($timestamp, $compare, $locale)); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | public static function formatDateSpanData(): array { |
@@ -88,28 +88,28 @@ discard block |
||
| 88 | 88 | $deL10N = Util::getL10N('lib', 'de'); |
| 89 | 89 | return [ |
| 90 | 90 | // Normal testing |
| 91 | - ['today', self::getTimestampAgo($time, 30, 15), $time], |
|
| 92 | - ['yesterday', self::getTimestampAgo($time, 0, 0, 0, 1), $time], |
|
| 93 | - ['tomorrow', $time, self::getTimestampAgo($time, 0, 0, 0, 1)], |
|
| 94 | - ['4 days ago', self::getTimestampAgo($time, 0, 0, 0, 4), $time], |
|
| 95 | - ['in 4 days', $time, self::getTimestampAgo($time, 0, 0, 0, 4)], |
|
| 96 | - ['5 months ago', self::getTimestampAgo($time, 0, 0, 0, 155), $time], |
|
| 97 | - ['next month', $time, self::getTimestampAgo($time, 0, 0, 0, 32)], |
|
| 98 | - ['in 5 months', $time, self::getTimestampAgo($time, 0, 0, 0, 155)], |
|
| 99 | - ['2 years ago', self::getTimestampAgo($time, 0, 0, 0, 0, 2), $time], |
|
| 100 | - ['next year', $time, self::getTimestampAgo($time, 0, 0, 0, 0, 1)], |
|
| 101 | - ['in 2 years', $time, self::getTimestampAgo($time, 0, 0, 0, 0, 2)], |
|
| 91 | + ['today', self::getTimestampAgo($time, 30, 15), $time], |
|
| 92 | + ['yesterday', self::getTimestampAgo($time, 0, 0, 0, 1), $time], |
|
| 93 | + ['tomorrow', $time, self::getTimestampAgo($time, 0, 0, 0, 1)], |
|
| 94 | + ['4 days ago', self::getTimestampAgo($time, 0, 0, 0, 4), $time], |
|
| 95 | + ['in 4 days', $time, self::getTimestampAgo($time, 0, 0, 0, 4)], |
|
| 96 | + ['5 months ago', self::getTimestampAgo($time, 0, 0, 0, 155), $time], |
|
| 97 | + ['next month', $time, self::getTimestampAgo($time, 0, 0, 0, 32)], |
|
| 98 | + ['in 5 months', $time, self::getTimestampAgo($time, 0, 0, 0, 155)], |
|
| 99 | + ['2 years ago', self::getTimestampAgo($time, 0, 0, 0, 0, 2), $time], |
|
| 100 | + ['next year', $time, self::getTimestampAgo($time, 0, 0, 0, 0, 1)], |
|
| 101 | + ['in 2 years', $time, self::getTimestampAgo($time, 0, 0, 0, 0, 2)], |
|
| 102 | 102 | |
| 103 | 103 | // Test with compare timestamp |
| 104 | - ['today', self::getTimestampAgo($time, 0, 0, 0, 0, 1), self::getTimestampAgo($time, 0, 0, 0, 0, 1)], |
|
| 105 | - ['yesterday', self::getTimestampAgo($time, 30, 15, 3, 1, 1), self::getTimestampAgo($time, 0, 0, 0, 0, 1)], |
|
| 106 | - ['4 days ago', self::getTimestampAgo($time, 30, 15, 3, 4, 1), self::getTimestampAgo($time, 0, 0, 0, 0, 1)], |
|
| 107 | - ['5 months ago', self::getTimestampAgo($time, 30, 15, 3, 155, 1), self::getTimestampAgo($time, 0, 0, 0, 0, 1)], |
|
| 108 | - ['2 years ago', self::getTimestampAgo($time, 30, 15, 3, 35, 3), self::getTimestampAgo($time, 0, 0, 0, 0, 1)], |
|
| 104 | + ['today', self::getTimestampAgo($time, 0, 0, 0, 0, 1), self::getTimestampAgo($time, 0, 0, 0, 0, 1)], |
|
| 105 | + ['yesterday', self::getTimestampAgo($time, 30, 15, 3, 1, 1), self::getTimestampAgo($time, 0, 0, 0, 0, 1)], |
|
| 106 | + ['4 days ago', self::getTimestampAgo($time, 30, 15, 3, 4, 1), self::getTimestampAgo($time, 0, 0, 0, 0, 1)], |
|
| 107 | + ['5 months ago', self::getTimestampAgo($time, 30, 15, 3, 155, 1), self::getTimestampAgo($time, 0, 0, 0, 0, 1)], |
|
| 108 | + ['2 years ago', self::getTimestampAgo($time, 30, 15, 3, 35, 3), self::getTimestampAgo($time, 0, 0, 0, 0, 1)], |
|
| 109 | 109 | |
| 110 | 110 | // Test translations |
| 111 | - [$deL10N->t('today'), new \DateTime('Wed, 02 Oct 2013 12:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N], |
|
| 112 | - [$deL10N->t('yesterday'), new \DateTime('Tue, 01 Oct 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000'), $deL10N], |
|
| 111 | + [$deL10N->t('today'), new \DateTime('Wed, 02 Oct 2013 12:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 23:59:59 +0000'), $deL10N], |
|
| 112 | + [$deL10N->t('yesterday'), new \DateTime('Tue, 01 Oct 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000'), $deL10N], |
|
| 113 | 113 | [$deL10N->n('%n day ago', '%n days ago', 2), new \DateTime('Mon, 30 Sep 2013 00:00:00 +0000'), new \DateTime('Wed, 02 Oct 2013 00:00:00 +0000'), $deL10N], |
| 114 | 114 | [$deL10N->n('%n month ago', '%n months ago', 9), new \DateTime('Tue, 31 Dec 2013 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000'), $deL10N], |
| 115 | 115 | [$deL10N->n('%n year ago', '%n years ago', 2), new \DateTime('Sun, 01 Jan 2012 00:00:00 +0000'), new \DateTime('Thu, 02 Oct 2014 00:00:00 +0000'), $deL10N], |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | #[\PHPUnit\Framework\Attributes\DataProvider('formatDateSpanData')] |
| 146 | 146 | public function testFormatDateSpan($expected, $timestamp, $compare = null, $locale = null): void { |
| 147 | - $this->assertEquals((string)$expected, (string)$this->formatter->formatDateSpan($timestamp, $compare, $locale)); |
|
| 147 | + $this->assertEquals((string) $expected, (string) $this->formatter->formatDateSpan($timestamp, $compare, $locale)); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | public static function formatDateData(): array { |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | #[\PHPUnit\Framework\Attributes\DataProvider('formatDateData')] |
| 157 | 157 | public function testFormatDate($timestamp, $expected): void { |
| 158 | - $this->assertEquals($expected, (string)$this->formatter->formatDate($timestamp)); |
|
| 158 | + $this->assertEquals($expected, (string) $this->formatter->formatDate($timestamp)); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | public static function formatDateTimeData(): array { |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | #[\PHPUnit\Framework\Attributes\DataProvider('formatDateTimeData')] |
| 169 | 169 | public function testFormatDateTime($timestamp, $timeZone, $expected): void { |
| 170 | - $this->assertEquals($expected, (string)$this->formatter->formatDateTime($timestamp, 'long', 'long', $timeZone)); |
|
| 170 | + $this->assertEquals($expected, (string) $this->formatter->formatDateTime($timestamp, 'long', 'long', $timeZone)); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | */ |
| 51 | 51 | #[\PHPUnit\Framework\Attributes\DataProvider('dataTestQuery')] |
| 52 | 52 | public function testQuery($serviceName, $instanceOf): void { |
| 53 | - $this->assertInstanceOf($instanceOf, $this->server->query($serviceName), 'Service "' . $serviceName . '"" did not return the right class'); |
|
| 53 | + $this->assertInstanceOf($instanceOf, $this->server->query($serviceName), 'Service "'.$serviceName.'"" did not return the right class'); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | public function testGetCertificateManager(): void { |
@@ -214,13 +214,13 @@ discard block |
||
| 214 | 214 | return [ |
| 215 | 215 | ['Id', '3', 3], |
| 216 | 216 | ['smallInt', '3', 3], |
| 217 | - ['bigInt', '' . PHP_INT_MAX, PHP_INT_MAX], |
|
| 217 | + ['bigInt', ''.PHP_INT_MAX, PHP_INT_MAX], |
|
| 218 | 218 | ['trueOrFalse', 0, false], |
| 219 | 219 | ['trueOrFalse', 1, true], |
| 220 | 220 | ['anotherBool', 0, false], |
| 221 | 221 | ['anotherBool', 1, true], |
| 222 | 222 | ['text', 33, '33'], |
| 223 | - ['longText', PHP_INT_MAX, '' . PHP_INT_MAX], |
|
| 223 | + ['longText', PHP_INT_MAX, ''.PHP_INT_MAX], |
|
| 224 | 224 | ]; |
| 225 | 225 | } |
| 226 | 226 | |
@@ -228,8 +228,8 @@ discard block |
||
| 228 | 228 | #[\PHPUnit\Framework\Attributes\DataProvider('dataSetterCasts')] |
| 229 | 229 | public function testSetterCasts(string $field, mixed $in, mixed $out): void { |
| 230 | 230 | $entity = new TestEntity(); |
| 231 | - $entity->{'set' . $field}($in); |
|
| 232 | - $this->assertSame($out, $entity->{'get' . $field}()); |
|
| 231 | + $entity->{'set'.$field}($in); |
|
| 232 | + $this->assertSame($out, $entity->{'get'.$field}()); |
|
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | #[\PHPUnit\Framework\Attributes\DataProvider('dataModified')] |
| 58 | 58 | public function testMiddleware(?string $etag, string $etagHeader, ?\DateTime $lastModified, string $lastModifiedHeader, bool $notModifiedSet): void { |
| 59 | 59 | $this->request->method('getHeader') |
| 60 | - ->willReturnCallback(function (string $name) use ($etagHeader, $lastModifiedHeader) { |
|
| 60 | + ->willReturnCallback(function(string $name) use ($etagHeader, $lastModifiedHeader) { |
|
| 61 | 61 | if ($name === 'IF_NONE_MATCH') { |
| 62 | 62 | return $etagHeader; |
| 63 | 63 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | public function testConstructorComplexInterface(): void { |
| 147 | 147 | $this->container->registerParameter('test', 'abc'); |
| 148 | 148 | $this->container->registerService( |
| 149 | - 'Test\AppFramework\Utility\IInterfaceConstructor', function ($c) { |
|
| 149 | + 'Test\AppFramework\Utility\IInterfaceConstructor', function($c) { |
|
| 150 | 150 | return $c->query('Test\AppFramework\Utility\ClassSimpleConstructor'); |
| 151 | 151 | }); |
| 152 | 152 | $object = $this->container->query( |
@@ -160,11 +160,11 @@ discard block |
||
| 160 | 160 | |
| 161 | 161 | public function testOverrideService(): void { |
| 162 | 162 | $this->container->registerService( |
| 163 | - 'Test\AppFramework\Utility\IInterfaceConstructor', function ($c) { |
|
| 163 | + 'Test\AppFramework\Utility\IInterfaceConstructor', function($c) { |
|
| 164 | 164 | return $c->query('Test\AppFramework\Utility\ClassSimpleConstructor'); |
| 165 | 165 | }); |
| 166 | 166 | $this->container->registerService( |
| 167 | - 'Test\AppFramework\Utility\IInterfaceConstructor', function ($c) { |
|
| 167 | + 'Test\AppFramework\Utility\IInterfaceConstructor', function($c) { |
|
| 168 | 168 | return $c->query('Test\AppFramework\Utility\ClassEmptyConstructor'); |
| 169 | 169 | }); |
| 170 | 170 | $object = $this->container->query( |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | public function testRegisterAliasService(): void { |
| 183 | - $this->container->registerService('test', function () { |
|
| 183 | + $this->container->registerService('test', function() { |
|
| 184 | 184 | return new \StdClass; |
| 185 | 185 | }, true); |
| 186 | 186 | $this->container->registerAlias('test1', 'test'); |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | |
| 204 | 204 | #[\PHPUnit\Framework\Attributes\DataProvider('sanitizeNameProvider')] |
| 205 | 205 | public function testSanitizeName($register, $query): void { |
| 206 | - $this->container->registerService($register, function () { |
|
| 206 | + $this->container->registerService($register, function() { |
|
| 207 | 207 | return 'abc'; |
| 208 | 208 | }); |
| 209 | 209 | $this->assertEquals('abc', $this->container->query($query)); |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | public function testRegisterFactory(): void { |
| 224 | - $this->container->registerService('test', function () { |
|
| 224 | + $this->container->registerService('test', function() { |
|
| 225 | 225 | return new \StdClass(); |
| 226 | 226 | }, false); |
| 227 | 227 | $this->assertNotSame( |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | public function testRegisterAliasFactory(): void { |
| 232 | - $this->container->registerService('test', function () { |
|
| 232 | + $this->container->registerService('test', function() { |
|
| 233 | 233 | return new \StdClass(); |
| 234 | 234 | }, false); |
| 235 | 235 | $this->container->registerAlias('test1', 'test'); |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | |
| 89 | 89 | #[\PHPUnit\Framework\Attributes\DataProvider('staticData')] |
| 90 | 90 | public function testLazyData(mixed $value): void { |
| 91 | - $this->service->provideLazyInitialState('test', 'key', function () use ($value) { |
|
| 91 | + $this->service->provideLazyInitialState('test', 'key', function() use ($value) { |
|
| 92 | 92 | return $value; |
| 93 | 93 | }); |
| 94 | 94 | $data = $this->service->getInitialStates(); |