Skip to content

Commit 8aa9aaf

Browse files
committed
Add trailing commas
1 parent 62686be commit 8aa9aaf

15 files changed

Lines changed: 98 additions & 97 deletions

public/login.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
'userName' => $mappedAttributes['user'],
198198
'attributes' => $mappedAttributes['attributes'],
199199
'proxies' => [],
200-
'sessionId' => $sessionTicket['id']
200+
'sessionId' => $sessionTicket['id'],
201201
]);
202202

203203
$ticketStore->addTicket($serviceTicket);

public/proxy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
'forceAuthn' => $proxyGrantingTicket['forceAuthn'],
6767
'attributes' => $proxyGrantingTicket['attributes'],
6868
'proxies' => $proxyGrantingTicket['proxies'],
69-
'sessionId' => $proxyGrantingTicket['sessionId']
69+
'sessionId' => $proxyGrantingTicket['sessionId'],
7070
]
7171
);
7272

public/utility/validateTicket.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
'attributes' => $attributes,
102102
'forceAuthn' => false,
103103
'proxies' => array_merge([$serviceUrl], $serviceTicket['proxies']),
104-
'sessionId' => $serviceTicket['sessionId']
104+
'sessionId' => $serviceTicket['sessionId'],
105105
]);
106106
$httpUtils = new Utils\HTTP();
107107
try {

src/Cas/AttributeExtractor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function extractUserAndAttributes(array $attributes, Configuration $casco
6161

6262
return [
6363
'user' => $userName,
64-
'attributes' => $casAttributes
64+
'attributes' => $casAttributes,
6565
];
6666
}
6767

@@ -79,7 +79,7 @@ private function invokeAuthProc(array $attributes, Configuration $casconfig): ar
7979
$filters = $casconfig->getOptionalArray('authproc', []);
8080

8181
$state = [
82-
'Attributes' => $attributes
82+
'Attributes' => $attributes,
8383
];
8484
foreach ($filters as $config) {
8585
$className = Module::resolveClass(

src/Cas/Protocol/SamlValidateResponder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function convertToSaml(array $ticket): Chunk
2929
$ar = new AuthnResponse();
3030
$idpMetadata = [
3131
// CAS doesn't seem to care what this is, however SSP code requires it to be set
32-
'entityid' => 'localhost'
32+
'entityid' => 'localhost',
3333
];
3434
$spMetadata = [
3535
'entityid' => $serviceUrl,

src/Cas/Ticket/SQLTicketStore.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ private function setTableVersion(string $name, int $version): void
185185
['_name'],
186186
[
187187
'_name' => $name,
188-
'_version' => $version
189-
]
188+
'_version' => $version,
189+
],
190190
);
191191
$this->tableVersions[$name] = $version;
192192
}

src/Cas/Ticket/TicketFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function createSessionTicket(string $sessionId, int $expiresAt): array
6262
return [
6363
'id' => $sessionId,
6464
'validBefore' => $expiresAt,
65-
'renewId' => $randomUtils->generateID()
65+
'renewId' => $randomUtils->generateID(),
6666
];
6767
}
6868

tests/config/module_casserver.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
'scopes' => [
1616
'mobile' => [
1717
'https://idp1.domain:1234/saml2/idp/metadata.php',
18-
'https://idp2.domain:5678/saml2/idp/metadata.php'
18+
'https://idp2.domain:5678/saml2/idp/metadata.php',
1919
],
2020
'desktop' => [
2121
'https://idp3.domain:1234/saml2/idp/metadata.php',
22-
'https://idp4.domain:5678/saml2/idp/metadata.php'
23-
]
22+
'https://idp4.domain:5678/saml2/idp/metadata.php',
23+
],
2424
],
2525

2626
'legal_service_urls' => [
@@ -33,7 +33,7 @@
3333
],
3434
'http://changeTicketParam' => [
3535
'ticketName' => 'myTicket',
36-
]
36+
],
3737
],
3838

3939
'legal_target_service_urls' => [

tests/public/LoginIntegrationTest.php

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ protected function setup(): void
8383

8484
'module.enable' => [
8585
'casserver' => true,
86-
]
86+
],
8787
]);
8888
}
8989

@@ -124,8 +124,8 @@ public function testNoQueryParameters(): void
124124
[
125125
CURLOPT_COOKIEJAR => $this->cookies_file,
126126
CURLOPT_COOKIEFILE => $this->cookies_file,
127-
CURLOPT_FOLLOWLOCATION => true
128-
]
127+
CURLOPT_FOLLOWLOCATION => true,
128+
],
129129
);
130130
$this->assertEquals(200, $resp['code']);
131131

@@ -148,15 +148,15 @@ public function testWrongServiceUrl(): void
148148
[
149149
CURLOPT_COOKIEJAR => $this->cookies_file,
150150
CURLOPT_COOKIEFILE => $this->cookies_file,
151-
CURLOPT_FOLLOWLOCATION => true
152-
]
151+
CURLOPT_FOLLOWLOCATION => true,
152+
],
153153
);
154154
$this->assertEquals(500, $resp['code']);
155155

156156
$this->assertStringContainsString(
157157
'CAS server is not listed as a legal service',
158158
$resp['body'],
159-
'Illegal cas service urls should be rejected'
159+
'Illegal cas service urls should be rejected',
160160
);
161161
}
162162

@@ -178,15 +178,15 @@ public function testValidServiceUrl(string $serviceParam, string $ticketParam):
178178
[$serviceParam => $service_url],
179179
[
180180
CURLOPT_COOKIEJAR => $this->cookies_file,
181-
CURLOPT_COOKIEFILE => $this->cookies_file
182-
]
181+
CURLOPT_COOKIEFILE => $this->cookies_file,
182+
],
183183
);
184184
$this->assertEquals(303, $resp['code']);
185185

186186
$this->assertStringStartsWith(
187187
$service_url . '?' . $ticketParam . '=ST-',
188188
$resp['headers']['Location'],
189-
'Ticket should be part of the redirect.'
189+
'Ticket should be part of the redirect.',
190190
);
191191

192192
// Config ticket can be validated
@@ -198,11 +198,11 @@ public function testValidServiceUrl(string $serviceParam, string $ticketParam):
198198
[
199199
$serviceParam => $service_url,
200200
'ticket' => $ticket,
201-
],
201+
],
202202
[
203203
CURLOPT_COOKIEJAR => $this->cookies_file,
204-
CURLOPT_COOKIEFILE => $this->cookies_file
205-
]
204+
CURLOPT_COOKIEFILE => $this->cookies_file,
205+
],
206206
);
207207

208208
$expectedResponse = DOMDocumentFactory::fromFile(
@@ -217,7 +217,7 @@ public function validServiceUrlProvider(): array
217217
{
218218
return [
219219
['service', 'ticket'],
220-
['TARGET', 'SAMLart']
220+
['TARGET', 'SAMLart'],
221221
];
222222
}
223223

@@ -235,15 +235,15 @@ public function testValidTicketNameOverride(): void
235235
['TARGET' => $service_url],
236236
[
237237
CURLOPT_COOKIEJAR => $this->cookies_file,
238-
CURLOPT_COOKIEFILE => $this->cookies_file
239-
]
238+
CURLOPT_COOKIEFILE => $this->cookies_file,
239+
],
240240
);
241241
$this->assertEquals(303, $resp['code']);
242242

243243
$this->assertStringStartsWith(
244244
$service_url . '?myTicket=ST-',
245245
$resp['headers']['Location'],
246-
'Ticket should be part of the redirect.'
246+
'Ticket should be part of the redirect.',
247247
);
248248
}
249249

@@ -260,15 +260,15 @@ public function testDebugOutput(): void
260260
['service' => $service_url, 'debugMode' => 'true'],
261261
[
262262
CURLOPT_COOKIEJAR => $this->cookies_file,
263-
CURLOPT_COOKIEFILE => $this->cookies_file
264-
]
263+
CURLOPT_COOKIEFILE => $this->cookies_file,
264+
],
265265
);
266266
$this->assertEquals(200, $resp['code']);
267267

268268
$this->assertStringContainsString(
269269
'<cas:eduPersonPrincipalName>testuser@example.com</cas:eduPersonPrincipalName>',
270270
$resp['body'],
271-
'Attributes should have been printed.'
271+
'Attributes should have been printed.',
272272
);
273273
}
274274

@@ -285,16 +285,16 @@ public function testDebugOutputSamlValidate(): void
285285
['service' => $service_url, 'debugMode' => 'samlValidate'],
286286
[
287287
CURLOPT_COOKIEJAR => $this->cookies_file,
288-
CURLOPT_COOKIEFILE => $this->cookies_file
289-
]
288+
CURLOPT_COOKIEFILE => $this->cookies_file,
289+
],
290290
);
291291
$this->assertEquals(200, $resp['code']);
292292

293293

294294
$this->assertStringContainsString(
295295
'testuser@example.com</NameIdentifier',
296296
$resp['body'],
297-
'Attributes should have been printed.'
297+
'Attributes should have been printed.',
298298
);
299299
}
300300

@@ -311,19 +311,19 @@ public function testAlternateServiceConfigUsed(): void
311311
['service' => $service_url, 'debugMode' => 'true'],
312312
[
313313
CURLOPT_COOKIEJAR => $this->cookies_file,
314-
CURLOPT_COOKIEFILE => $this->cookies_file
315-
]
314+
CURLOPT_COOKIEFILE => $this->cookies_file,
315+
],
316316
);
317317
$this->assertEquals(200, $resp['code']);
318318
$this->assertStringContainsString(
319319
'<cas:user>testuser</cas:user>',
320320
$resp['body'],
321-
'cas:user attribute should have been overridden'
321+
'cas:user attribute should have been overridden',
322322
);
323323
$this->assertStringContainsString(
324324
'<cas:cn>Test User</cas:cn>',
325325
$resp['body'],
326-
'Attributes should have been printed with alternate attribute release'
326+
'Attributes should have been printed with alternate attribute release',
327327
);
328328
}
329329

@@ -344,8 +344,8 @@ public function testValidServiceUrlWithPost(): void
344344
],
345345
[
346346
CURLOPT_COOKIEJAR => $this->cookies_file,
347-
CURLOPT_COOKIEFILE => $this->cookies_file
348-
]
347+
CURLOPT_COOKIEFILE => $this->cookies_file,
348+
],
349349
);
350350

351351
// POST responds with a form that is uses JavaScript to submit
@@ -372,12 +372,12 @@ public function testValidServiceUrlWithPost(): void
372372
}
373373
$this->assertEquals(
374374
'ticket',
375-
$item->getAttribute('name')
375+
$item->getAttribute('name'),
376376
);
377377
$this->assertStringStartsWith(
378378
'ST-',
379379
$item->getAttribute('value'),
380-
''
380+
'',
381381
);
382382
}
383383

@@ -394,15 +394,15 @@ public function testSamlValidate(): void
394394
['service' => $service_url],
395395
[
396396
CURLOPT_COOKIEJAR => $this->cookies_file,
397-
CURLOPT_COOKIEFILE => $this->cookies_file
398-
]
397+
CURLOPT_COOKIEFILE => $this->cookies_file,
398+
],
399399
);
400400
$this->assertEquals(303, $resp['code']);
401401

402402
$this->assertStringStartsWith(
403403
$service_url . '?ticket=ST-',
404404
$resp['headers']['Location'],
405-
'Ticket should be part of the redirect.'
405+
'Ticket should be part of the redirect.',
406406
);
407407

408408
$location = $resp['headers']['Location'];
@@ -425,7 +425,7 @@ public function testSamlValidate(): void
425425
$soapRequest,
426426
[
427427
'TARGET' => $service_url,
428-
]
428+
],
429429
);
430430

431431
$this->assertEquals(200, $resp['code']);
@@ -445,8 +445,8 @@ private function authenticate(): void
445445
[
446446
CURLOPT_COOKIEJAR => $this->cookies_file,
447447
CURLOPT_COOKIEFILE => $this->cookies_file,
448-
CURLOPT_FOLLOWLOCATION => true
449-
]
448+
CURLOPT_FOLLOWLOCATION => true,
449+
],
450450
);
451451
$this->assertEquals(200, $resp['code'], $resp['body']);
452452
}

0 commit comments

Comments
 (0)