@@ -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)); |
@@ -62,12 +62,12 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | private function rrmdir($directory) { |
65 | - $files = array_diff(scandir($directory), ['.','..']); |
|
65 | + $files = array_diff(scandir($directory), ['.', '..']); |
|
66 | 66 | foreach ($files as $file) { |
67 | - if (is_dir($directory . '/' . $file)) { |
|
68 | - $this->rrmdir($directory . '/' . $file); |
|
67 | + if (is_dir($directory.'/'.$file)) { |
|
68 | + $this->rrmdir($directory.'/'.$file); |
|
69 | 69 | } else { |
70 | - unlink($directory . '/' . $file); |
|
70 | + unlink($directory.'/'.$file); |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 | return rmdir($directory); |
@@ -80,13 +80,13 @@ discard block |
||
80 | 80 | public function testFindWithAppPathSymlink(): void { |
81 | 81 | // First create new apps path, and a symlink to it |
82 | 82 | $apps_dirname = $this->randomString(); |
83 | - $new_apps_path = sys_get_temp_dir() . '/' . $apps_dirname; |
|
84 | - $new_apps_path_symlink = $new_apps_path . '_link'; |
|
83 | + $new_apps_path = sys_get_temp_dir().'/'.$apps_dirname; |
|
84 | + $new_apps_path_symlink = $new_apps_path.'_link'; |
|
85 | 85 | mkdir($new_apps_path); |
86 | 86 | symlink($apps_dirname, $new_apps_path_symlink); |
87 | 87 | |
88 | 88 | // Create an app within that path |
89 | - mkdir($new_apps_path . '/' . 'test-css-app'); |
|
89 | + mkdir($new_apps_path.'/'.'test-css-app'); |
|
90 | 90 | |
91 | 91 | // Use the symlink as the app path |
92 | 92 | \OC::$APPSROOTS[] = [ |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | $webRoot = $resource[1]; |
107 | 107 | $file = $resource[2]; |
108 | 108 | |
109 | - $expectedRoot = $new_apps_path . '/test-css-app'; |
|
110 | - $expectedWebRoot = \OC::$WEBROOT . '/css-apps-test/test-css-app'; |
|
109 | + $expectedRoot = $new_apps_path.'/test-css-app'; |
|
110 | + $expectedWebRoot = \OC::$WEBROOT.'/css-apps-test/test-css-app'; |
|
111 | 111 | $expectedFile = 'test-file.css'; |
112 | 112 | |
113 | 113 | $this->assertEquals($expectedRoot, $root, |
@@ -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) { |
@@ -98,9 +98,9 @@ |
||
98 | 98 | 'only version hash if not installed' => ['apps/shipped', 'style.css', false, false, '?v=version_hash'], |
99 | 99 | 'version hash with cache buster if app not found' => ['unknown/path', '', true, false, '?v=version_hash-42'], |
100 | 100 | 'version hash with cache buster if neither path nor file provided' => [false, false, true, false, '?v=version_hash-42'], |
101 | - 'app version hash if external app' => ['', 'other/app.css', true, false, '?v=' . substr(md5('other_2'), 0, 8) . '-42'], |
|
102 | - 'app version and version hash if shipped app' => ['apps/shipped', 'style.css', true, false, '?v=' . substr(md5('shipped_1-version_hash'), 0, 8) . '-42'], |
|
103 | - 'prefer path over file' => ['apps/shipped', 'other/app.css', true, false, '?v=' . substr(md5('shipped_1-version_hash'), 0, 8) . '-42'], |
|
101 | + 'app version hash if external app' => ['', 'other/app.css', true, false, '?v='.substr(md5('other_2'), 0, 8).'-42'], |
|
102 | + 'app version and version hash if shipped app' => ['apps/shipped', 'style.css', true, false, '?v='.substr(md5('shipped_1-version_hash'), 0, 8).'-42'], |
|
103 | + 'prefer path over file' => ['apps/shipped', 'other/app.css', true, false, '?v='.substr(md5('shipped_1-version_hash'), 0, 8).'-42'], |
|
104 | 104 | ]; |
105 | 105 | } |
106 | 106 |
@@ -52,10 +52,10 @@ |
||
52 | 52 | |
53 | 53 | public function testClear(): void { |
54 | 54 | $value = 'ipsum lorum'; |
55 | - $this->instance->set('1_value1', $value . '1'); |
|
56 | - $this->instance->set('1_value2', $value . '2'); |
|
57 | - $this->instance->set('2_value1', $value . '3'); |
|
58 | - $this->instance->set('3_value1', $value . '4'); |
|
55 | + $this->instance->set('1_value1', $value.'1'); |
|
56 | + $this->instance->set('1_value2', $value.'2'); |
|
57 | + $this->instance->set('2_value1', $value.'3'); |
|
58 | + $this->instance->set('3_value1', $value.'4'); |
|
59 | 59 | |
60 | 60 | $this->assertEquals([ |
61 | 61 | '1_value1' => 'ipsum lorum1', |
@@ -40,7 +40,7 @@ |
||
40 | 40 | $this->timeFactory = $this->createMock(ITimeFactory::class); |
41 | 41 | $this->timeFactory->expects($this->any()) |
42 | 42 | ->method('getTime') |
43 | - ->willReturnCallback(function () { |
|
43 | + ->willReturnCallback(function() { |
|
44 | 44 | return $this->currentTime; |
45 | 45 | }); |
46 | 46 | parent::setUp(); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $path = '/usr/sbin/sendmail'; |
93 | 93 | } |
94 | 94 | |
95 | - $expected = new SendmailTransport($path . $binaryParam, null, $this->logger); |
|
95 | + $expected = new SendmailTransport($path.$binaryParam, null, $this->logger); |
|
96 | 96 | $this->assertEquals($expected, self::invokePrivate($this->mailer, 'getSendMailInstance')); |
97 | 97 | } |
98 | 98 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | ['mail_sendmailmode', 'smtp', $sendmailMode], |
111 | 111 | ]); |
112 | 112 | |
113 | - $sendmail = new SendmailTransport('/var/qmail/bin/sendmail' . $binaryParam, null, $this->logger); |
|
113 | + $sendmail = new SendmailTransport('/var/qmail/bin/sendmail'.$binaryParam, null, $this->logger); |
|
114 | 114 | $this->assertEquals($sendmail, self::invokePrivate($this->mailer, 'getSendMailInstance')); |
115 | 115 | } |
116 | 116 |