@@ -41,7 +41,7 @@ |
||
41 | 41 | ->with('core', 'backgroundjobs_mode', $mode); |
42 | 42 | |
43 | 43 | $commandTester = new CommandTester($this->command); |
44 | - $commandTester->execute(['command' => 'background:' . $mode]); |
|
44 | + $commandTester->execute(['command' => 'background:'.$mode]); |
|
45 | 45 | |
46 | 46 | $commandTester->assertCommandIsSuccessful(); |
47 | 47 |
@@ -76,10 +76,10 @@ discard block |
||
76 | 76 | ->method('get') |
77 | 77 | ->with('8b9da631d1f7b022bb2c3c489e16092f82b42fd4') |
78 | 78 | ->willReturn(json_encode([ |
79 | - '1' . '#' . hash('sha1', 'action1') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
80 | - '300' . '#' . hash('sha1', 'action1') . '#' . hash('sha1', json_encode(['metadata2'])), |
|
81 | - '1' . '#' . hash('sha1', 'action2') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
82 | - '300' . '#' . hash('sha1', 'action2') . '#' . hash('sha1', json_encode(['metadata2'])), |
|
79 | + '1'.'#'.hash('sha1', 'action1').'#'.hash('sha1', json_encode(['metadata1'])), |
|
80 | + '300'.'#'.hash('sha1', 'action1').'#'.hash('sha1', json_encode(['metadata2'])), |
|
81 | + '1'.'#'.hash('sha1', 'action2').'#'.hash('sha1', json_encode(['metadata1'])), |
|
82 | + '300'.'#'.hash('sha1', 'action2').'#'.hash('sha1', json_encode(['metadata2'])), |
|
83 | 83 | ])); |
84 | 84 | |
85 | 85 | $this->assertSame($expected, $this->backend->getAttempts('10.10.10.10/32', $maxAge, $action, $metadata)); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | ->method('set') |
97 | 97 | ->with( |
98 | 98 | '8b9da631d1f7b022bb2c3c489e16092f82b42fd4', |
99 | - json_encode(['223#' . hash('sha1', 'action1') . '#' . hash('sha1', json_encode(['metadata1']))]) |
|
99 | + json_encode(['223#'.hash('sha1', 'action1').'#'.hash('sha1', json_encode(['metadata1']))]) |
|
100 | 100 | ); |
101 | 101 | |
102 | 102 | $this->backend->registerAttempt('10.10.10.10', '10.10.10.10/32', 223, 'action1', ['metadata1']); |
@@ -113,12 +113,12 @@ discard block |
||
113 | 113 | ->method('get') |
114 | 114 | ->with('8b9da631d1f7b022bb2c3c489e16092f82b42fd4') |
115 | 115 | ->willReturn(json_encode([ |
116 | - '1#' . hash('sha1', 'action1') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
117 | - '2#' . hash('sha1', 'action2') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
118 | - '87#' . hash('sha1', 'action3') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
119 | - '123#' . hash('sha1', 'action4') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
120 | - '123#' . hash('sha1', 'action5') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
121 | - '124#' . hash('sha1', 'action6') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
116 | + '1#'.hash('sha1', 'action1').'#'.hash('sha1', json_encode(['metadata1'])), |
|
117 | + '2#'.hash('sha1', 'action2').'#'.hash('sha1', json_encode(['metadata1'])), |
|
118 | + '87#'.hash('sha1', 'action3').'#'.hash('sha1', json_encode(['metadata1'])), |
|
119 | + '123#'.hash('sha1', 'action4').'#'.hash('sha1', json_encode(['metadata1'])), |
|
120 | + '123#'.hash('sha1', 'action5').'#'.hash('sha1', json_encode(['metadata1'])), |
|
121 | + '124#'.hash('sha1', 'action6').'#'.hash('sha1', json_encode(['metadata1'])), |
|
122 | 122 | ])); |
123 | 123 | $this->cache |
124 | 124 | ->expects($this->once()) |
@@ -126,11 +126,11 @@ discard block |
||
126 | 126 | ->with( |
127 | 127 | '8b9da631d1f7b022bb2c3c489e16092f82b42fd4', |
128 | 128 | json_encode([ |
129 | - '87#' . hash('sha1', 'action3') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
130 | - '123#' . hash('sha1', 'action4') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
131 | - '123#' . hash('sha1', 'action5') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
132 | - '124#' . hash('sha1', 'action6') . '#' . hash('sha1', json_encode(['metadata1'])), |
|
133 | - '186#' . hash('sha1', 'action7') . '#' . hash('sha1', json_encode(['metadata2'])), |
|
129 | + '87#'.hash('sha1', 'action3').'#'.hash('sha1', json_encode(['metadata1'])), |
|
130 | + '123#'.hash('sha1', 'action4').'#'.hash('sha1', json_encode(['metadata1'])), |
|
131 | + '123#'.hash('sha1', 'action5').'#'.hash('sha1', json_encode(['metadata1'])), |
|
132 | + '124#'.hash('sha1', 'action6').'#'.hash('sha1', json_encode(['metadata1'])), |
|
133 | + '186#'.hash('sha1', 'action7').'#'.hash('sha1', json_encode(['metadata2'])), |
|
134 | 134 | ]) |
135 | 135 | ); |
136 | 136 |
@@ -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 | } |