@@ -35,7 +35,7 @@ |
||
| 35 | 35 | |
| 36 | 36 | public function testGetNonce(): void { |
| 37 | 37 | $secret = base64_encode('secret'); |
| 38 | - $tokenValue = base64_encode('secret' ^ 'value_') . ':' . $secret; |
|
| 38 | + $tokenValue = base64_encode('secret' ^ 'value_').':'.$secret; |
|
| 39 | 39 | $token = $this->createMock(CsrfToken::class); |
| 40 | 40 | $token |
| 41 | 41 | ->expects($this->once()) |
@@ -65,6 +65,6 @@ |
||
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | public function testToString(): void { |
| 68 | - $this->assertSame('127.0.0.1', (string)(new IpAddress('127.0.0.1'))); |
|
| 68 | + $this->assertSame('127.0.0.1', (string) (new IpAddress('127.0.0.1'))); |
|
| 69 | 69 | } |
| 70 | 70 | } |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | ]); |
| 41 | 41 | |
| 42 | 42 | $trustedDomainHelper = new TrustedDomainHelper($this->config); |
| 43 | - $this->assertEquals($result, $trustedDomainHelper->isTrustedUrl('https://' . $testDomain . '/index.php/something')); |
|
| 43 | + $this->assertEquals($result, $trustedDomainHelper->isTrustedUrl('https://'.$testDomain.'/index.php/something')); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |
@@ -23,11 +23,11 @@ discard block |
||
| 23 | 23 | protected function setUp(): void { |
| 24 | 24 | parent::setUp(); |
| 25 | 25 | |
| 26 | - $goodCertificate = file_get_contents(__DIR__ . '/../../data/certificates/goodCertificate.crt'); |
|
| 26 | + $goodCertificate = file_get_contents(__DIR__.'/../../data/certificates/goodCertificate.crt'); |
|
| 27 | 27 | $this->goodCertificate = new Certificate($goodCertificate, 'GoodCertificate'); |
| 28 | - $badCertificate = file_get_contents(__DIR__ . '/../../data/certificates/badCertificate.crt'); |
|
| 28 | + $badCertificate = file_get_contents(__DIR__.'/../../data/certificates/badCertificate.crt'); |
|
| 29 | 29 | $this->invalidCertificate = new Certificate($badCertificate, 'BadCertificate'); |
| 30 | - $expiredCertificate = file_get_contents(__DIR__ . '/../../data/certificates/expiredCertificate.crt'); |
|
| 30 | + $expiredCertificate = file_get_contents(__DIR__.'/../../data/certificates/expiredCertificate.crt'); |
|
| 31 | 31 | $this->expiredCertificate = new Certificate($expiredCertificate, 'ExpiredCertificate'); |
| 32 | 32 | } |
| 33 | 33 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | public function testOpenSslTrustedCertificateFormat(): void { |
| 44 | - $trustedCertificate = file_get_contents(__DIR__ . '/../../data/certificates/openSslTrustedCertificate.crt'); |
|
| 44 | + $trustedCertificate = file_get_contents(__DIR__.'/../../data/certificates/openSslTrustedCertificate.crt'); |
|
| 45 | 45 | $certificate = new Certificate($trustedCertificate, 'TrustedCertificate'); |
| 46 | 46 | $this->assertSame('thawte, Inc.', $certificate->getOrganization()); |
| 47 | 47 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $this->expectException(\Exception::class); |
| 51 | 51 | $this->expectExceptionMessage('Certificate could not get parsed.'); |
| 52 | 52 | |
| 53 | - new Certificate('file://' . __DIR__ . '/../../data/certificates/goodCertificate.crt', 'bar'); |
|
| 53 | + new Certificate('file://'.__DIR__.'/../../data/certificates/goodCertificate.crt', 'bar'); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | public function testGetName(): void { |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | ->willReturn('357111317'); |
| 105 | 105 | |
| 106 | 106 | $this->crypto->method('decrypt') |
| 107 | - ->with('encryptedToken', 'foobar' . '357111317') |
|
| 107 | + ->with('encryptedToken', 'foobar'.'357111317') |
|
| 108 | 108 | ->willThrowException(new \Exception('decryption failed')); |
| 109 | 109 | |
| 110 | 110 | $this->expectException(InvalidTokenException::class); |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | ->willReturn('357111317'); |
| 132 | 132 | |
| 133 | 133 | $this->crypto->method('decrypt') |
| 134 | - ->with('encryptedToken', 'foobar' . '357111317') |
|
| 134 | + ->with('encryptedToken', 'foobar'.'357111317') |
|
| 135 | 135 | ->willReturn('decrypted^nonsense'); |
| 136 | 136 | |
| 137 | 137 | $this->expectException(InvalidTokenException::class); |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | ->willReturn('357111317'); |
| 162 | 162 | |
| 163 | 163 | $this->crypto->method('decrypt') |
| 164 | - ->with('encryptedToken', 'foobar' . '357111317') |
|
| 164 | + ->with('encryptedToken', 'foobar'.'357111317') |
|
| 165 | 165 | ->willReturn('604800:mY70K3n'); |
| 166 | 166 | |
| 167 | 167 | $this->timeFactory->expects($this->any()) |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | ->willReturn('357111317'); |
| 196 | 196 | |
| 197 | 197 | $this->crypto->method('decrypt') |
| 198 | - ->with('encryptedToken', 'foobar' . '357111317') |
|
| 198 | + ->with('encryptedToken', 'foobar'.'357111317') |
|
| 199 | 199 | ->willReturn('604800:mY70K3n'); |
| 200 | 200 | |
| 201 | 201 | $this->timeFactory->expects($this->any()) |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | ->willReturn('357111317'); |
| 230 | 230 | |
| 231 | 231 | $this->crypto->method('decrypt') |
| 232 | - ->with('encryptedToken', 'foobar' . '357111317') |
|
| 232 | + ->with('encryptedToken', 'foobar'.'357111317') |
|
| 233 | 233 | ->willReturn('604802:mY70K3n'); |
| 234 | 234 | |
| 235 | 235 | $this->timeFactory->expects($this->any()) |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | ->willReturn('357111317'); |
| 264 | 264 | |
| 265 | 265 | $this->crypto->method('decrypt') |
| 266 | - ->with('encryptedToken', 'foobar' . '357111317') |
|
| 266 | + ->with('encryptedToken', 'foobar'.'357111317') |
|
| 267 | 267 | ->willReturn('604802:barfoo'); |
| 268 | 268 | |
| 269 | 269 | $this->timeFactory->expects($this->any()) |
@@ -68,12 +68,12 @@ |
||
| 68 | 68 | ['1.2.3.4', ['1.2.3.*'], true], |
| 69 | 69 | ['fc00:1:2:3::1', ['fc00::/7'], true], |
| 70 | 70 | ['1.2.3.4', ['192.168.1.2/24', '1.2.3.0/24'], true], |
| 71 | - ['1234:4567:8910::1', ['fe80::/8','1234:4567::/16'], true], |
|
| 71 | + ['1234:4567:8910::1', ['fe80::/8', '1234:4567::/16'], true], |
|
| 72 | 72 | // Blocked IP |
| 73 | 73 | ['192.168.1.5', ['1.2.3.*'], false], |
| 74 | 74 | ['9234:4567:8910::', ['1234:4567::1'], false], |
| 75 | 75 | ['192.168.2.1', ['192.168.1.2/24', '1.2.3.0/24'], false], |
| 76 | - ['9234:4567:8910::', ['fe80::/8','1234:4567::/16'], false], |
|
| 76 | + ['9234:4567:8910::', ['fe80::/8', '1234:4567::/16'], false], |
|
| 77 | 77 | ]; |
| 78 | 78 | } |
| 79 | 79 | } |
@@ -144,7 +144,7 @@ |
||
| 144 | 144 | ->willReturn(array_keys($allowList)); |
| 145 | 145 | |
| 146 | 146 | $this->appConfig->method('getValueString') |
| 147 | - ->willReturnCallback(function ($app, $key, $default) use ($allowList) { |
|
| 147 | + ->willReturnCallback(function($app, $key, $default) use ($allowList) { |
|
| 148 | 148 | if ($app !== 'bruteForce') { |
| 149 | 149 | return $default; |
| 150 | 150 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $this->config = $this->createMock(IConfig::class); |
| 116 | 116 | |
| 117 | 117 | $this->config->method('getSystemValueInt') |
| 118 | - ->willReturnCallback(function ($name, $default) { |
|
| 118 | + ->willReturnCallback(function($name, $default) { |
|
| 119 | 119 | return $default; |
| 120 | 120 | }); |
| 121 | 121 | |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | $this->config |
| 144 | 144 | ->expects($this->any()) |
| 145 | 145 | ->method('getSystemValue') |
| 146 | - ->willReturnCallback(function ($key, $default) { |
|
| 146 | + ->willReturnCallback(function($key, $default) { |
|
| 147 | 147 | if ($key === 'passwordsalt') { |
| 148 | 148 | return '6Wow67q1wZQZpUUeI6G2LsWUu4XKx'; |
| 149 | 149 | } |
@@ -185,13 +185,13 @@ discard block |
||
| 185 | 185 | |
| 186 | 186 | $message = 'mysecret'; |
| 187 | 187 | |
| 188 | - $blowfish = 1 . '|' . password_hash($message, PASSWORD_BCRYPT, []); |
|
| 189 | - $argon2 = 2 . '|' . password_hash($message, PASSWORD_ARGON2I, []); |
|
| 188 | + $blowfish = 1.'|'.password_hash($message, PASSWORD_BCRYPT, []); |
|
| 189 | + $argon2 = 2.'|'.password_hash($message, PASSWORD_ARGON2I, []); |
|
| 190 | 190 | |
| 191 | 191 | $newAlg = PASSWORD_ARGON2I; |
| 192 | 192 | if (\defined('PASSWORD_ARGON2ID')) { |
| 193 | 193 | $newAlg = PASSWORD_ARGON2ID; |
| 194 | - $argon2 = 2 . '|' . password_hash($message, PASSWORD_ARGON2ID, []); |
|
| 194 | + $argon2 = 2.'|'.password_hash($message, PASSWORD_ARGON2ID, []); |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | |
| 215 | 215 | $message = 'mysecret'; |
| 216 | 216 | |
| 217 | - $argon2i = 2 . '|' . password_hash($message, PASSWORD_ARGON2I, []); |
|
| 217 | + $argon2i = 2.'|'.password_hash($message, PASSWORD_ARGON2I, []); |
|
| 218 | 218 | |
| 219 | 219 | $newHash = null; |
| 220 | 220 | $this->assertTrue($this->hasher->verify($message, $argon2i, $newHash)); |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | |
| 239 | 239 | $message = 'mysecret'; |
| 240 | 240 | |
| 241 | - $argon2id = 3 . '|' . password_hash($message, PASSWORD_ARGON2ID, []); |
|
| 241 | + $argon2id = 3.'|'.password_hash($message, PASSWORD_ARGON2ID, []); |
|
| 242 | 242 | |
| 243 | 243 | $newHash = null; |
| 244 | 244 | $this->assertTrue($this->hasher->verify($message, $argon2id, $newHash)); |
@@ -57,12 +57,12 @@ discard block |
||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | private function rrmdir($directory) { |
| 60 | - $files = array_diff(scandir($directory), ['.','..']); |
|
| 60 | + $files = array_diff(scandir($directory), ['.', '..']); |
|
| 61 | 61 | foreach ($files as $file) { |
| 62 | - if (is_dir($directory . '/' . $file)) { |
|
| 63 | - $this->rrmdir($directory . '/' . $file); |
|
| 62 | + if (is_dir($directory.'/'.$file)) { |
|
| 63 | + $this->rrmdir($directory.'/'.$file); |
|
| 64 | 64 | } else { |
| 65 | - unlink($directory . '/' . $file); |
|
| 65 | + unlink($directory.'/'.$file); |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | return rmdir($directory); |
@@ -77,15 +77,15 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | // First create new apps path, and a symlink to it |
| 79 | 79 | $apps_dirname = $this->randomString(); |
| 80 | - $new_apps_path = sys_get_temp_dir() . '/' . $apps_dirname; |
|
| 81 | - $new_apps_path_symlink = $new_apps_path . '_link'; |
|
| 80 | + $new_apps_path = sys_get_temp_dir().'/'.$apps_dirname; |
|
| 81 | + $new_apps_path_symlink = $new_apps_path.'_link'; |
|
| 82 | 82 | $this->assertTrue(( |
| 83 | 83 | mkdir($new_apps_path) && symlink($apps_dirname, $new_apps_path_symlink) |
| 84 | 84 | ), 'Setup of apps path failed'); |
| 85 | 85 | |
| 86 | 86 | // Create an app within that path |
| 87 | 87 | $this->assertTrue(( |
| 88 | - mkdir($new_apps_path . '/' . $appName) && touch($new_apps_path . '/' . $appName . '/' . 'test-file.js') |
|
| 88 | + mkdir($new_apps_path.'/'.$appName) && touch($new_apps_path.'/'.$appName.'/'.'test-file.js') |
|
| 89 | 89 | ), 'Setup of app within the new apps path failed'); |
| 90 | 90 | |
| 91 | 91 | // Use the symlink as the app path |
@@ -111,8 +111,8 @@ discard block |
||
| 111 | 111 | $file = $resource[2]; |
| 112 | 112 | |
| 113 | 113 | $expectedRoot = $new_apps_path; |
| 114 | - $expectedWebRoot = \OC::$WEBROOT . '/js-apps-test'; |
|
| 115 | - $expectedFile = $appName . '/test-file.js'; |
|
| 114 | + $expectedWebRoot = \OC::$WEBROOT.'/js-apps-test'; |
|
| 115 | + $expectedFile = $appName.'/test-file.js'; |
|
| 116 | 116 | |
| 117 | 117 | $this->assertEquals($expectedRoot, $root, |
| 118 | 118 | 'Ensure the app path symlink is resolved into the real path'); |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | public function testFindModuleJSWithFallback(): void { |
| 148 | 148 | // First create new apps path, and a symlink to it |
| 149 | 149 | $apps_dirname = $this->randomString(); |
| 150 | - $new_apps_path = sys_get_temp_dir() . '/' . $apps_dirname; |
|
| 150 | + $new_apps_path = sys_get_temp_dir().'/'.$apps_dirname; |
|
| 151 | 151 | mkdir($new_apps_path); |
| 152 | 152 | |
| 153 | 153 | // Create an app within that path |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | $resources = $locator->getResources(); |
| 170 | 170 | $this->assertCount(3, $resources); |
| 171 | 171 | |
| 172 | - $expectedWebRoot = \OC::$WEBROOT . '/js-apps-test/test-js-app'; |
|
| 172 | + $expectedWebRoot = \OC::$WEBROOT.'/js-apps-test/test-js-app'; |
|
| 173 | 173 | $expectedFiles = ['module.mjs', 'both.mjs', 'plain.js']; |
| 174 | 174 | |
| 175 | 175 | for ($idx = 0; $idx++; $idx < 3) { |