Skip to content

Commit 7b650b6

Browse files
committed
Add trailing commas
1 parent a4d1ee0 commit 7b650b6

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

src/Auth/Process/Fticks.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private function log(string $msg): void
105105
$rfc5424_message = sprintf(
106106
'<%d>',
107107
((($this->logconfig['facility'] & 0x03f8) >> 3) * 8) +
108-
(array_key_exists('priority', $this->logconfig) ? $this->logconfig['priority'] : LOG_INFO)
108+
(array_key_exists('priority', $this->logconfig) ? $this->logconfig['priority'] : LOG_INFO),
109109
); // pri
110110
$rfc5424_message .= '1 '; // ver
111111
$rfc5424_message .= gmdate('Y-m-d\TH:i:s.v\Z '); // timestamp
@@ -123,7 +123,7 @@ private function log(string $msg): void
123123
strlen($rfc5424_message),
124124
0,
125125
gethostbyname(array_key_exists('host', $this->logconfig) ? $this->logconfig['host'] : 'localhost'),
126-
array_key_exists('port', $this->logconfig) ? $this->logconfig['port'] : 514
126+
array_key_exists('port', $this->logconfig) ? $this->logconfig['port'] : 514,
127127
);
128128
break;
129129

@@ -265,7 +265,7 @@ public function __construct(array $config, $reserved)
265265
$this->logdest = $config['logdest'];
266266
} else {
267267
throw new Error\Exception(
268-
'F-ticks log destination must be one of [local, remote, stdout, errorlog, simplesamlphp]'
268+
'F-ticks log destination must be one of [local, remote, stdout, errorlog, simplesamlphp]',
269269
);
270270
}
271271
}
@@ -274,7 +274,7 @@ public function __construct(array $config, $reserved)
274274
$globalConfig = Configuration::getInstance();
275275
$defaultFacility = $globalConfig->getOptionalInteger(
276276
'logging.facility',
277-
defined('LOG_LOCAL5') ? constant('LOG_LOCAL5') : LOG_USER
277+
defined('LOG_LOCAL5') ? constant('LOG_LOCAL5') : LOG_USER,
278278
);
279279
$defaultProcessName = $globalConfig->getOptionalString('logging.processname', 'SimpleSAMLphp');
280280
if (array_key_exists('logconfig', $config)) {
@@ -313,7 +313,7 @@ private function warnRiskyLogSettings(int $defaultFacility, string $defaultProce
313313
) {
314314
Logger::warning(
315315
'F-ticks syslog facility differs from global config which may cause'
316-
. ' SimpleSAMLphp\'s logging to behave inconsistently'
316+
. ' SimpleSAMLphp\'s logging to behave inconsistently',
317317
);
318318
}
319319
if (
@@ -322,7 +322,7 @@ private function warnRiskyLogSettings(int $defaultFacility, string $defaultProce
322322
) {
323323
Logger::warning(
324324
'F-ticks syslog processname differs from global config which may cause'
325-
. ' SimpleSAMLphp\'s logging to behave inconsistently'
325+
. ' SimpleSAMLphp\'s logging to behave inconsistently',
326326
);
327327
}
328328
}
@@ -443,8 +443,8 @@ function ($k, $v) {
443443
return $k . '=' . $this->escapeFticks(strval($v));
444444
},
445445
array_keys($fticks),
446-
$fticks
447-
)
446+
$fticks,
447+
),
448448
);
449449

450450
return sprintf('F-TICKS/%s/%s#%s#', $this->federation, self::$fticksVersion, $attributes);

tests/src/Auth/Process/FticksTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function testMinimal(): void
7878
$request = self::$minRequest;
7979
$pattern = preg_quote(
8080
'F-TICKS/ACME/1.0#RESULT=OK#AP=https://localhost/sp#RP=https://localhost/idp#CSI=CL',
81-
'/'
81+
'/',
8282
);
8383
$this->expectOutputRegex('/^' . $pattern . '[^#]+#TS=\d+#$/');
8484
$result = self::processFilter($config, $request);
@@ -94,7 +94,7 @@ public function testAsServiceProvider(): void
9494
$request = array_merge(self::$minRequest, self::$spRequest);
9595
$pattern1 = preg_quote(
9696
'F-TICKS/ACME/1.0#RESULT=OK#AP=https://localhost/saml:sp:IdP#RP=https://localhost/idp#CSI=CL',
97-
'/'
97+
'/',
9898
);
9999
$pattern2 = preg_quote('#AM=urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified#TS=1000#', '/');
100100
$this->expectOutputRegex('/^' . $pattern1 . '[^#]+' . $pattern2 . '$/');
@@ -115,12 +115,12 @@ public function testSPwithUserId(): void
115115
]);
116116
$pattern1 = preg_quote(
117117
'F-TICKS/ACME/1.0#RESULT=OK#AP=https://localhost/saml:sp:IdP#RP=https://localhost/idp#CSI=CL',
118-
'/'
118+
'/',
119119
);
120120
$pattern2 = preg_quote(
121121
'#AM=' . Constants::AC_UNSPECIFIED
122122
. '#PN=e5d066a96d5809a21264e153013c3c793e6574cb77afdfa248ad2cefab9b0451#TS=1000#',
123-
'/'
123+
'/',
124124
);
125125
$this->expectOutputRegex('/^' . $pattern1 . '[^#]+' . $pattern2 . '$/');
126126
$result = self::processFilter($config, $request);
@@ -140,12 +140,12 @@ public function testAsIdentityProvider(): void
140140
]);
141141
$pattern1 = preg_quote(
142142
'F-TICKS/ACME/1.0#RESULT=OK#AP=https://localhost/sp#RP=https://localhost/idp#CSI=CL',
143-
'/'
143+
'/',
144144
);
145145
$pattern2 = preg_quote(
146146
'#AM=' . Constants::AC_PASSWORD
147147
. '#PN=d844a9a0666bb3990e88f72b8f5c20accbcfa46f7b8a7ab38593bfbbab6e9cbc#TS=',
148-
'/'
148+
'/',
149149
);
150150
$this->expectOutputRegex('/^' . $pattern1 . '[^#]+' . $pattern2 . '\d+#$/');
151151
$result = self::processFilter($config, $request);
@@ -174,11 +174,11 @@ public function testExample(): void
174174
]);
175175
$pattern1 = preg_quote(
176176
'F-TICKS/ACME/1.0#RESULT=OK#AP=https://localhost/sp#RP=https://localhost/idp#CSI=CL',
177-
'/'
177+
'/',
178178
);
179179
$pattern2 = preg_quote(
180180
'#AM=urn:oasis:names:tc:SAML:2.0:ac:classes:Password#TS=',
181-
'/'
181+
'/',
182182
);
183183
$this->expectOutputRegex('/^' . $pattern1 . '[^#]+' . $pattern2 . '\d+#REALM=example.com#$/');
184184
$result = self::processFilter($config, $request);
@@ -199,7 +199,7 @@ public function testFilteringArray(): void
199199
$request = array_merge(self::$minRequest, self::$idpRequest, ['Attributes' => ['uid' => 'user1@example.org']]);
200200
$pattern1 = preg_quote(
201201
'F-TICKS/ACME/1.0#RESULT=OK#AP=https://localhost/sp#RP=https://localhost/idp#CSI=CL',
202-
'/'
202+
'/',
203203
);
204204
$this->expectOutputRegex('/^' . $pattern1 . '[^#]+#TS=\d+#$/');
205205
$result = self::processFilter($config, $request);
@@ -215,11 +215,11 @@ public function testFilteringString(): void
215215
$request = array_merge(self::$minRequest, self::$idpRequest, ['Attributes' => ['uid' => 'user1@example.org']]);
216216
$pattern1 = preg_quote(
217217
'F-TICKS/ACME/1.0#RESULT=OK#AP=https://localhost/sp#RP=https://localhost/idp#CSI=CL',
218-
'/'
218+
'/',
219219
);
220220
$pattern2 = preg_quote(
221221
'#PN=d844a9a0666bb3990e88f72b8f5c20accbcfa46f7b8a7ab38593bfbbab6e9cbc#TS=',
222-
'/'
222+
'/',
223223
);
224224
$this->expectOutputRegex('/^' . $pattern1 . '[^#]+' . $pattern2 . '\d+#$/');
225225
$result = self::processFilter($config, $request);
@@ -243,7 +243,7 @@ public function testRiskyLogSettings(): void
243243
Logger::setCaptureLog();
244244
$result = self::processFilter(
245245
['federation' => 'ACME', 'logdest' => 'local', 'logconfig' => ['processname' => 'phpunit']],
246-
self::$minRequest
246+
self::$minRequest,
247247
);
248248
$log = Logger::getCapturedLog();
249249
$this->assertCount(1, $log);

0 commit comments

Comments
 (0)