Skip to content

Commit 33514e5

Browse files
committed
Add trailing commas
1 parent 2a72cac commit 33514e5

4 files changed

Lines changed: 18 additions & 17 deletions

File tree

src/Controller/MetaRefresh.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class MetaRefresh
4343
* @throws \Exception
4444
*/
4545
public function __construct(
46-
Configuration $config
46+
Configuration $config,
4747
) {
4848
$this->config = $config;
4949
$this->module_config = Configuration::getConfig('module_metarefresh.php');

src/MetaLoader.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function loadSource(array $source): void
148148
$entities = $this->loadXML($data, $source);
149149
} catch (Exception $e) {
150150
Logger::notice(
151-
'XML parser error when parsing ' . $source['src'] . ' - attempting to re-use cached metadata'
151+
'XML parser error when parsing ' . $source['src'] . ' - attempting to re-use cached metadata',
152152
);
153153
Logger::debug('XML parser returned: ' . $e->getMessage());
154154
$this->addCachedMetadata($source);
@@ -199,7 +199,7 @@ public function loadSource(array $source): void
199199
$source['src'],
200200
$attributeAuthorities[0],
201201
'attributeauthority-remote',
202-
$template
202+
$template,
203203
);
204204
}
205205
}
@@ -221,7 +221,7 @@ private function processCertificates(Metadata\SAMLParser $entity, array $source)
221221
if (!$entity->validateSignature($source['certificates'])) {
222222
$entityId = $entity->getEntityId();
223223
Logger::notice(
224-
'Skipping "' . $entityId . '" - could not verify signature using certificate.' . "\n"
224+
'Skipping "' . $entityId . '" - could not verify signature using certificate.' . "\n",
225225
);
226226
return false;
227227
}
@@ -481,7 +481,7 @@ public function writeState(): void
481481
"<?php\n/* This file was generated by the metarefresh module at " . $this->getTime() . ".\n" .
482482
" Do not update it manually as it will get overwritten. */\n" .
483483
'$state = ' . var_export($this->state, true) . ";\n",
484-
0644
484+
0644,
485485
);
486486
}
487487
}
@@ -577,7 +577,7 @@ public function writeARPfile(Configuration $config): void
577577
$md,
578578
$config->getOptionalString('attributemap', ''),
579579
$config->getOptionalString('prefix', ''),
580-
$config->getOptionalString('suffix', '')
580+
$config->getOptionalString('suffix', ''),
581581
);
582582

583583

tests/src/ARPTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function testARP(): void
1515
$config = Configuration::loadFromArray(
1616
['module.enable' => ['metarefresh' => true]],
1717
'[ARRAY]',
18-
'simplesaml'
18+
'simplesaml',
1919
);
2020
Configuration::setPreLoadedConfig($config, 'config.php');
2121

tests/src/MetaLoaderTest.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace SimpleSAML\Test\Module\metarefresh;
66

7+
use Exception;
78
use PHPUnit\Framework\TestCase;
89
use SimpleSAML\Configuration;
910

@@ -77,7 +78,7 @@ protected function setUp(): void
7778
$this->config = Configuration::loadFromArray(
7879
['module.enable' => ['metarefresh' => true]],
7980
'[ARRAY]',
80-
'simplesaml'
81+
'simplesaml',
8182
);
8283
Configuration::setPreLoadedConfig($this->config, 'config.php');
8384
$this->metaloader = new \SimpleSAML\Module\metarefresh\MetaLoader();
@@ -106,20 +107,20 @@ public function testMetaLoader(): void
106107
$output = $this->getActualOutputForAssertion();
107108
try {
108109
eval($output);
109-
} catch (\Exception $e) {
110+
} catch (Exception $e) {
110111
$this->fail('Metarefresh does not produce syntactially valid code');
111112
}
112113
$this->assertArrayHasKey('https://idp.example.com/idp/shibboleth', $metadata);
113114

114115
$this->assertTrue(
115-
empty(array_diff_key($this->expected, $metadata['https://idp.example.com/idp/shibboleth']))
116+
empty(array_diff_key($this->expected, $metadata['https://idp.example.com/idp/shibboleth'])),
116117
);
117118
}
118119

119120
public function testSignatureVerificationCertificatePass(): void
120121
{
121122
$this->metaloader->loadSource(
122-
array_merge($this->source, ['certificates' => [dirname(__FILE__, 2) . '/mdx.pem']])
123+
array_merge($this->source, ['certificates' => [dirname(__FILE__, 2) . '/mdx.pem']]),
123124
);
124125
$this->metaloader->dumpMetadataStdOut();
125126
$this->expectOutputRegex('/UTEbMBkGA1UECgwSRXhhbXBsZSBVbml2ZXJzaXR5MRgwFgYDVQQDDA9pZHAuZXhh/');
@@ -140,7 +141,7 @@ public function testWriteMetadataFiles(): void
140141
$this->assertArrayHasKey('https://idp.example.com/idp/shibboleth', $metadata);
141142
$this->assertTrue(
142143
/** @psalm-suppress UndefinedVariable */
143-
empty(array_diff_key($this->expected, $metadata['https://idp.example.com/idp/shibboleth']))
144+
empty(array_diff_key($this->expected, $metadata['https://idp.example.com/idp/shibboleth'])),
144145
);
145146
}
146147

@@ -158,7 +159,7 @@ public function testMetaLoaderSetExpiryWhenNotPresent(): void
158159
$output = $this->getActualOutputForAssertion();
159160
try {
160161
eval($output);
161-
} catch (\Exception $e) {
162+
} catch (Exception $e) {
162163
$this->fail('Metarefresh does not produce syntactially valid code');
163164
}
164165
$this->assertArrayHasKey('https://idp.example.com/idp/shibboleth', $metadata);
@@ -189,14 +190,14 @@ public function testAttributewhitelist1(): void
189190
$output = $this->getActualOutputForAssertion();
190191
try {
191192
eval($output);
192-
} catch (\Exception $e) {
193+
} catch (Exception $e) {
193194
$this->fail('Metarefresh does not produce syntactially valid code');
194195
}
195196
/* Check we matched the IdP */
196197
$this->assertArrayHasKey('https://idp.example.com/idp/shibboleth', $metadata);
197198

198199
$this->assertTrue(
199-
empty(array_diff_key($this->expected, $metadata['https://idp.example.com/idp/shibboleth']))
200+
empty(array_diff_key($this->expected, $metadata['https://idp.example.com/idp/shibboleth'])),
200201
);
201202
}
202203

@@ -257,15 +258,15 @@ public function testAttributewhitelist3(): void
257258
$output = $this->getActualOutputForAssertion();
258259
try {
259260
eval($output);
260-
} catch (\Exception $e) {
261+
} catch (Exception $e) {
261262
$this->fail('Metarefresh does not produce syntactially valid code');
262263
}
263264

264265
/* Check we matched the IdP */
265266
$this->assertArrayHasKey('https://idp.example.com/idp/shibboleth', $metadata);
266267

267268
$this->assertTrue(
268-
empty(array_diff_key($this->expected, $metadata['https://idp.example.com/idp/shibboleth']))
269+
empty(array_diff_key($this->expected, $metadata['https://idp.example.com/idp/shibboleth'])),
269270
);
270271
}
271272
}

0 commit comments

Comments
 (0)