Completed
Push — master ( dc48b6...a1f4b5 )
by
unknown
37:52 queued 15s
created
tests/lib/AppConfigTest.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 				$type = $row[2] ?? IAppConfig::VALUE_MIXED;
133 133
 				if (($row[4] ?? false) === true) {
134 134
 					$type |= IAppConfig::VALUE_SENSITIVE;
135
-					$value = self::invokePrivate(AppConfig::class, 'ENCRYPTION_PREFIX') . $this->crypto->encrypt($value);
135
+					$value = self::invokePrivate(AppConfig::class, 'ENCRYPTION_PREFIX').$this->crypto->encrypt($value);
136 136
 					self::$baseStruct[$appId][$key]['encrypted'] = $value;
137 137
 				}
138 138
 
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 			foreach ($appData as $row) {
251 251
 				$keys[] = $row[0];
252 252
 			}
253
-			$appKeys[] = [(string)$appId, $keys];
253
+			$appKeys[] = [(string) $appId, $keys];
254 254
 		}
255 255
 
256 256
 		return $appKeys;
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 		foreach (self::$baseStruct as $appId => $appData) {
270 270
 			foreach ($appData as $row) {
271 271
 				$appKeys[] = [
272
-					(string)$appId, $row[0], $row[1], $row[2] ?? IAppConfig::VALUE_MIXED, $row[3] ?? false,
272
+					(string) $appId, $row[0], $row[1], $row[2] ?? IAppConfig::VALUE_MIXED, $row[3] ?? false,
273 273
 					$row[4] ?? false
274 274
 				];
275 275
 			}
@@ -1390,7 +1390,7 @@  discard block
 block discarded – undo
1390 1390
 		$key = self::getUniqueID('secret');
1391 1391
 
1392 1392
 		$appConfig = $this->generateAppConfig();
1393
-		$secret = md5((string)time());
1393
+		$secret = md5((string) time());
1394 1394
 		$appConfig->setValueString('testapp', $key, $secret, sensitive: true);
1395 1395
 
1396 1396
 		$this->assertConfigValueNotEquals('testapp', $key, $secret);
@@ -1408,7 +1408,7 @@  discard block
 block discarded – undo
1408 1408
 	public function testMigratingNonSensitiveValueToSensitiveWithSetValue(): void {
1409 1409
 		$key = self::getUniqueID('secret');
1410 1410
 		$appConfig = $this->generateAppConfig();
1411
-		$secret = sha1((string)time());
1411
+		$secret = sha1((string) time());
1412 1412
 
1413 1413
 		// Unencrypted
1414 1414
 		$appConfig->setValueString('testapp', $key, $secret);
@@ -1436,7 +1436,7 @@  discard block
 block discarded – undo
1436 1436
 	public function testUpdateSensitiveValueToNonSensitiveWithUpdateSensitive(): void {
1437 1437
 		$key = self::getUniqueID('secret');
1438 1438
 		$appConfig = $this->generateAppConfig();
1439
-		$secret = sha1((string)time());
1439
+		$secret = sha1((string) time());
1440 1440
 
1441 1441
 		// Encrypted
1442 1442
 		$appConfig->setValueString('testapp', $key, $secret, sensitive: true);
@@ -1450,7 +1450,7 @@  discard block
 block discarded – undo
1450 1450
 	public function testUpdateNonSensitiveValueToSensitiveWithUpdateSensitive(): void {
1451 1451
 		$key = self::getUniqueID('secret');
1452 1452
 		$appConfig = $this->generateAppConfig();
1453
-		$secret = sha1((string)time());
1453
+		$secret = sha1((string) time());
1454 1454
 
1455 1455
 		// Unencrypted
1456 1456
 		$appConfig->setValueString('testapp', $key, $secret);
@@ -1478,7 +1478,7 @@  discard block
 block discarded – undo
1478 1478
 		$this->assertEquals(['search_key5_lazy'], $appConfig->searchKeys('searchtest', 'search_', true));
1479 1479
 	}
1480 1480
 
1481
-	protected function loadConfigValueFromDatabase(string $app, string $key): string|false {
1481
+	protected function loadConfigValueFromDatabase(string $app, string $key): string | false {
1482 1482
 		$sql = $this->connection->getQueryBuilder();
1483 1483
 		$sql->select('configvalue')
1484 1484
 			->from('appconfig')
@@ -1493,11 +1493,11 @@  discard block
 block discarded – undo
1493 1493
 		return $actual;
1494 1494
 	}
1495 1495
 
1496
-	protected function assertConfigKey(string $app, string $key, string|false $expected): void {
1496
+	protected function assertConfigKey(string $app, string $key, string | false $expected): void {
1497 1497
 		$this->assertEquals($expected, $this->loadConfigValueFromDatabase($app, $key));
1498 1498
 	}
1499 1499
 
1500
-	protected function assertConfigValueNotEquals(string $app, string $key, string|false $expected): void {
1500
+	protected function assertConfigValueNotEquals(string $app, string $key, string | false $expected): void {
1501 1501
 		$this->assertNotEquals($expected, $this->loadConfigValueFromDatabase($app, $key));
1502 1502
 	}
1503 1503
 }
Please login to merge, or discard this patch.