Skip to content

Commit

Permalink
Add trailing commas
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Aug 5, 2024
1 parent ce49e58 commit 5afa503
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
Empty file removed src/Constants.php
Empty file.
16 changes: 8 additions & 8 deletions src/Controller/Adfs.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ public function metadata(Request $request): Response
'SingleSignOnService' => [
0 => [
'Binding' => Constants::BINDING_HTTP_REDIRECT,
'Location' => $adfs_service_location
]
'Location' => $adfs_service_location,
],
],
'SingleLogoutService' => [
0 => [
'Binding' => Constants::BINDING_HTTP_REDIRECT,
'Location' => $adfs_service_location
]
'Location' => $adfs_service_location,
],
],
];

Expand All @@ -146,14 +146,14 @@ public function metadata(Request $request): Response

$metaArray['NameIDFormat'] = $idpmeta->getOptionalString(
'NameIDFormat',
Constants::NAMEID_TRANSIENT
Constants::NAMEID_TRANSIENT,
);

if ($idpmeta->hasValue('OrganizationName')) {
$metaArray['OrganizationName'] = $idpmeta->getLocalizedString('OrganizationName');
$metaArray['OrganizationDisplayName'] = $idpmeta->getOptionalLocalizedString(
'OrganizationDisplayName',
$metaArray['OrganizationName']
$metaArray['OrganizationName'],
);

if (!$idpmeta->hasValue('OrganizationURL')) {
Expand Down Expand Up @@ -237,7 +237,7 @@ public function prp(Request $request): Response
return new StreamedResponse(
function () use ($idp) {
ADFS_IDP::receiveLogoutMessage($idp);
}
},
);
} elseif ($wa === 'wsignin1.0') {
return ADFS_IDP::receiveAuthnRequest($request, $idp);
Expand All @@ -255,7 +255,7 @@ function () use ($idp) {
return new StreamedResponse(
function () use ($idp, /** @scrutinizer ignore-type */ $assocId, $relayState, $logoutError) {
$idp->handleLogoutResponse($assocId, $relayState, $logoutError);
}
},
);
}
throw new SspError\BadRequest("Missing parameter 'wa' or 'assocId' in request.");
Expand Down
22 changes: 11 additions & 11 deletions src/IdP/ADFS.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static function receiveAuthnRequest(Request $request, IdP $idp): Streamed
'ForceAuthn' => false,
'isPassive' => false,
'adfs:wctx' => $requestid,
'adfs:wreply' => false
'adfs:wreply' => false,
];

if (isset($query['wreply']) && !empty($query['wreply'])) {
Expand All @@ -55,7 +55,7 @@ public static function receiveAuthnRequest(Request $request, IdP $idp): Streamed
return new StreamedResponse(
function () use ($idp, &$state) {
$idp->handleAuthenticationRequest($state);
}
},
);
}

Expand All @@ -73,7 +73,7 @@ private static function generateResponse(
string $target,
string $nameid,
array $attributes,
int $assertionLifetime
int $assertionLifetime,
): string {
$httpUtils = new Utils\HTTP();
$randomUtils = new Utils\Random();
Expand Down Expand Up @@ -120,7 +120,7 @@ private static function generateResponse(

list($namespace, $name) = $attrUtils->getAttributeNamespace(
$name,
'http://schemas.xmlsoap.org/claims'
'http://schemas.xmlsoap.org/claims',
);
$namespace = htmlspecialchars($namespace);
$name = htmlspecialchars($name);
Expand Down Expand Up @@ -184,7 +184,7 @@ private static function signResponse(
[$firstassertionroot],
XMLSecurityDSig::SHA256,
['http://www.w3.org/2000/09/xmldsig#enveloped-signature', XMLSecurityDSig::EXC_C14N],
['id_name' => 'AssertionID']
['id_name' => 'AssertionID'],
);

$objKey = new XMLSecurityKey($algo, ['type' => 'private']);
Expand Down Expand Up @@ -246,7 +246,7 @@ public static function getHostedMetadata(string $entityid): array
[
'Binding' => Constants::BINDING_HTTP_REDIRECT,
'Location' => $endpoint,
]
],
],
'SingleLogoutService' => [
'Binding' => Constants::BINDING_HTTP_REDIRECT,
Expand Down Expand Up @@ -289,7 +289,7 @@ public static function getHostedMetadata(string $entityid): array
'signing' => true,
'encryption' => false,
'X509Certificate' => $httpsCert['certData'],
'prefix' => 'https.'
'prefix' => 'https.',
];
}
$metadata['keys'] = $keys;
Expand All @@ -299,7 +299,7 @@ public static function getHostedMetadata(string $entityid): array
$metadata['OrganizationName'] = $config->getLocalizedString('OrganizationName');
$metadata['OrganizationDisplayName'] = $config->getOptionalLocalizedString(
'OrganizationDisplayName',
$metadata['OrganizationName']
$metadata['OrganizationName'],
);

if (!$config->hasValue('OrganizationURL')) {
Expand Down Expand Up @@ -361,7 +361,7 @@ public static function sendResponse(array $state): void
$spEntityId = $spMetadata['entityid'];
$spMetadata = Configuration::loadFromArray(
$spMetadata,
'$metadata[' . var_export($spEntityId, true) . ']'
'$metadata[' . var_export($spEntityId, true) . ']',
);

$attributes = $state['Attributes'];
Expand Down Expand Up @@ -421,7 +421,7 @@ public static function sendLogoutResponse(IdP $idp, array $state): void
$idpMetadata = $idp->getConfig();
$httpUtils = new Utils\HTTP();
$httpUtils->redirectTrustedURL(
$idpMetadata->getOptionalString('redirect-after-logout', $httpUtils->getBaseURL())
$idpMetadata->getOptionalString('redirect-after-logout', $httpUtils->getBaseURL()),
);
}

Expand Down Expand Up @@ -464,7 +464,7 @@ public static function getLogoutURL(IdP $idp, array $association, string $relayS
$metadata = MetaDataStorageHandler::getMetadataHandler();
$spMetadata = $metadata->getMetaDataConfig($association['adfs:entityID'], 'adfs-sp-remote');
$returnTo = Module::getModuleURL(
'adfs/idp/prp.php?assocId=' . urlencode($association["id"]) . '&relayState=' . urlencode($relayState)
'adfs/idp/prp.php?assocId=' . urlencode($association["id"]) . '&relayState=' . urlencode($relayState),
);
return $spMetadata->getValue('prp') . '?wa=wsignoutcleanup1.0&wreply=' . urlencode($returnTo);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/src/Controller/AdfsControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected function setup(): void
],
],
'[ARRAY]',
'simplesaml'
'simplesaml',
);
$this->session = Session::getSessionFromRequest();

Expand All @@ -66,7 +66,7 @@ public function testNoQueryParameters(): void

$this->expectException(Error\BadRequest::class);
$this->expectExceptionMessage(
"BADREQUEST('%REASON%' => 'Missing parameter \'wa\' or \'assocId\' in request.')"
"BADREQUEST('%REASON%' => 'Missing parameter \'wa\' or \'assocId\' in request.')",
);

$c->prp($request);
Expand Down

0 comments on commit 5afa503

Please sign in to comment.