From f3e2e491cd7a2da9445b81c4637209bb9d6de711 Mon Sep 17 00:00:00 2001
From: Guy Halse <guy@tenet.ac.za>
Date: Tue, 2 Oct 2018 17:12:32 +0200
Subject: [PATCH] Use array_shift rather than array_values

---
 modules/saml/lib/IdP/SAML2.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/saml/lib/IdP/SAML2.php b/modules/saml/lib/IdP/SAML2.php
index 350f9b5c6..3cdb14fa3 100644
--- a/modules/saml/lib/IdP/SAML2.php
+++ b/modules/saml/lib/IdP/SAML2.php
@@ -986,9 +986,9 @@ class SAML2
 
         if ($nameIdFormat === null || !isset($state['saml:NameID'][$nameIdFormat])) {
             // either not set in request, or not set to a format we supply. Fall back to old generation method
-            $nameIdFormat = array_values($spMetadata->getArrayizeString('NameIDFormat', null))[0];
+            $nameIdFormat = array_shift($spMetadata->getArrayizeString('NameIDFormat', null));
             if ($nameIdFormat === null) {
-                $nameIdFormat = array_values($idpMetadata->getArrayizeString('NameIDFormat', \SAML2\Constants::NAMEID_TRANSIENT))[0];
+                $nameIdFormat = array_shift($idpMetadata->getArrayizeString('NameIDFormat', \SAML2\Constants::NAMEID_TRANSIENT));
             }
         }
 
-- 
GitLab