Skip to content

Commit ad88333

Browse files
committed
coding style: trailing comma
1 parent faf8ac3 commit ad88333

15 files changed

Lines changed: 35 additions & 33 deletions

public/login.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,6 @@
233233
}
234234
} else {
235235
$httpUtils->redirectTrustedURL(
236-
$httpUtils->addURLParameters(Module::getModuleURL('casserver/loggedIn.php'), $parameters)
236+
$httpUtils->addURLParameters(Module::getModuleURL('casserver/loggedIn.php'), $parameters),
237237
);
238238
}

public/logout.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171
$as->logout(
7272
$httpUtils->addURLParameters(
7373
\SimpleSAML\Module::getModuleURL('casserver/loggedOut.php'),
74-
array_key_exists('url', $_GET) ? ['url' => $_GET['url']] : []
75-
)
74+
array_key_exists('url', $_GET) ? ['url' => $_GET['url']] : [],
75+
),
7676
);
7777
}
7878
} else {
@@ -84,8 +84,8 @@
8484
$httpUtils->redirectTrustedURL(
8585
$httpUtils->addURLParameters(
8686
\SimpleSAML\Module::getModuleURL('casserver/loggedOut.php'),
87-
array_key_exists('url', $_GET) ? ['url' => $_GET['url']] : []
88-
)
87+
array_key_exists('url', $_GET) ? ['url' => $_GET['url']] : [],
88+
),
8989
);
9090
}
9191
}

public/proxy.php

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

7373
$ticketStore->addTicket($proxyTicket);

public/utility/validateTicket.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
try {
5555
$ticketStoreConfig = $casconfig->getOptionalValue(
5656
'ticketstore',
57-
['class' => 'casserver:FileSystemTicketStore']
57+
['class' => 'casserver:FileSystemTicketStore'],
5858
);
5959
$ticketStoreClass = Module::resolveClass($ticketStoreConfig['class'], 'Cas\Ticket');
6060
/** @var TicketStore $ticketStore */
@@ -180,7 +180,7 @@
180180
}
181181
} catch (Exception $e) {
182182
Logger::error(
183-
'casserver:serviceValidate: internal server error. ' . var_export($e->getMessage(), true)
183+
'casserver:serviceValidate: internal server error. ' . var_export($e->getMessage(), true),
184184
);
185185

186186
echo $protocol->getValidateFailureResponse(C::ERR_INTERNAL_ERROR, $e->getMessage());

public/validate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
/* Instantiate ticket store */
4646
$ticketStoreConfig = $casconfig->getOptionalValue(
4747
'ticketstore',
48-
['class' => 'casserver:FileSystemTicketStore']
48+
['class' => 'casserver:FileSystemTicketStore'],
4949
);
5050
$ticketStoreClass = \SimpleSAML\Module::resolveClass($ticketStoreConfig['class'], 'Cas\Ticket');
5151
/** @psalm-suppress InvalidStringClass */
@@ -73,7 +73,7 @@
7373
if (!array_key_exists($usernameField, $serviceTicket['attributes'])) {
7474
\SimpleSAML\Logger::error(sprintf(
7575
'casserver:validate: internal server error. Missing user name attribute: %s',
76-
var_export($usernameField, true)
76+
var_export($usernameField, true),
7777
));
7878

7979
echo $protocol->getValidateFailureResponse();

src/Cas/AttributeExtractor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace SimpleSAML\Module\casserver\Cas;
66

7+
use SimpleSAML\Auth;
78
use SimpleSAML\Configuration;
89
use SimpleSAML\Module;
910

@@ -85,7 +86,7 @@ private function invokeAuthProc(array $attributes, Configuration $casconfig): ar
8586
$className = Module::resolveClass(
8687
$config['class'],
8788
'Auth\Process',
88-
\SimpleSAML\Auth\ProcessingFilter::class
89+
Auth\ProcessingFilter::class,
8990
);
9091
// Unset 'class' to prevent the filter from interpreting it as an option
9192
unset($config['class']);

src/Cas/Protocol/Cas20.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function getValidateSuccessResponse(string $username): AuthenticationSucc
145145
if (!is_null($this->base64IndicatorAttribute)) {
146146
$attr[] = $this->generateCas20Attribute(
147147
$this->base64IndicatorAttribute,
148-
$this->base64EncodeAttributes ? "true" : "false"
148+
$this->base64EncodeAttributes ? "true" : "false",
149149
);
150150
}
151151
}
@@ -212,7 +212,7 @@ public function getProxyFailureResponse(string $errorCode, string $explanation):
212212
*/
213213
private function generateCas20Attribute(
214214
string $attributeName,
215-
string $attributeValue
215+
string $attributeValue,
216216
): Chunk {
217217
$xmlDocument = DOMDocumentFactory::create();
218218

@@ -241,7 +241,7 @@ private function isValidXmlName(string $name): bool
241241
return filter_var(
242242
$name,
243243
FILTER_VALIDATE_REGEXP,
244-
['options' => ['regexp' => '/^[a-zA-Z_][\w.-]*$/']]
244+
['options' => ['regexp' => '/^[a-zA-Z_][\w.-]*$/']],
245245
) === true;
246246
}
247247
}

src/Cas/Protocol/SamlValidateResponder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,22 @@ public function convertToSaml(array $ticket): Chunk
3939
Configuration::loadFromArray($idpMetadata),
4040
Configuration::loadFromArray($spMetadata),
4141
$shire,
42-
$attributes
42+
$attributes,
4343
);
4444

4545
// replace NameIdentifier with actually username
4646
$ret = preg_replace(
4747
'|<NameIdentifier(.*)>.*</NameIdentifier>|',
4848
'<NameIdentifier$1>' . htmlspecialchars($user) . '</NameIdentifier>',
49-
$authnResponseXML
49+
$authnResponseXML,
5050
);
5151
// CAS seems to prefer this type of assertiond
5252
$ret = str_replace('urn:oasis:names:tc:SAML:1.0:cm:bearer', 'urn:oasis:names:tc:SAML:1.0:cm:artifact', $ret);
5353
// CAS uses a different namespace for attributes
5454
$ret = str_replace(
5555
'urn:mace:shibboleth:1.0:attributeNamespace:uri',
5656
'http://www.ja-sig.org/products/cas/',
57-
$ret
57+
$ret,
5858
);
5959

6060
$doc = DOMDocumentFactory::fromString($ret);

src/Cas/TicketValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(Configuration $casconfig)
3434
$this->casconfig = $casconfig;
3535
$ticketStoreConfig = $casconfig->getOptionalValue(
3636
'ticketstore',
37-
['class' => 'casserver:FileSystemTicketStore']
37+
['class' => 'casserver:FileSystemTicketStore'],
3838
);
3939
$ticketStoreClass = Module::resolveClass($ticketStoreConfig['class'], 'Cas\Ticket');
4040
/**
@@ -108,7 +108,7 @@ public static function sanitize(string $parameter): string
108108
return preg_replace(
109109
'/;jsessionid=.*[^?].*$/U',
110110
'',
111-
preg_replace('/;jsessionid=.*[?]/U', '?', urldecode($parameter))
111+
preg_replace('/;jsessionid=.*[?]/U', '?', urldecode($parameter)),
112112
);
113113
}
114114
}

src/Shib13/AuthnResponse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function validate(): bool
141141
$this->validator->validateCA($configUtils->getCertPath($md->getString('caFile')));
142142
} else {
143143
throw new Error\Exception(
144-
'Missing certificate in Shibboleth 1.3 IdP Remote metadata for identity provider [' . $issuer . '].'
144+
'Missing certificate in Shibboleth 1.3 IdP Remote metadata for identity provider [' . $issuer . '].',
145145
);
146146
}
147147

@@ -261,7 +261,7 @@ public function getAttributes(): array
261261

262262
$attribute_nodes = $this->doXPathQuery(
263263
'shib:AttributeStatement/shib:Attribute/shib:AttributeValue',
264-
$assertion
264+
$assertion,
265265
);
266266

267267
foreach ($attribute_nodes as $attribute) {

0 commit comments

Comments
 (0)