Skip to content
Snippets Groups Projects
Commit c94d1758 authored by Thijs Kinkhorst's avatar Thijs Kinkhorst
Browse files

Refactor to avoid using pre-PHP 7 operator

parent e792f956
No related branches found
No related tags found
No related merge requests found
......@@ -330,11 +330,15 @@ class FederationController
/** @var \SimpleSAML\Module\saml\Auth\Source\SP $source */
foreach (\SimpleSAML\Auth\Source::getSourcesOfType('saml:SP') as $source) {
$metadata = $source->getHostedMetadata();
$certificates = $metadata['keys'] ?? [];
if (count($certificates) === 1) {
$cert = array_pop($metadata['keys']);
$metadata['certData'] = $cert['X509Certificate'];
unset($metadata['keys']);
if (isset($metadata['keys']) ) {
$certificates = $metadata['keys'];
if (count($metadata['keys']) === 1) {
$cert = array_pop($metadata['keys']);
$metadata['certData'] = $cert['X509Certificate'];
unset($metadata['keys']);
}
} else {
$certificates = [];
}
// get the name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment