From bb528b7dfb6aef9754593cc59cb0dfd052d12183 Mon Sep 17 00:00:00 2001
From: Thijs Kinkhorst <thijs@kinkhorst.com>
Date: Tue, 13 Nov 2018 19:38:56 +0000
Subject: [PATCH] Update to modern array syntax

---
 lib/SimpleSAML/Utils/Config/Metadata.php | 8 ++++----
 modules/saml/lib/Auth/Source/SP.php      | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/SimpleSAML/Utils/Config/Metadata.php b/lib/SimpleSAML/Utils/Config/Metadata.php
index 0ef14d230..1d34039cb 100644
--- a/lib/SimpleSAML/Utils/Config/Metadata.php
+++ b/lib/SimpleSAML/Utils/Config/Metadata.php
@@ -293,21 +293,21 @@ class Metadata
 
         if (is_string($nameIdPolicy)) {
             // handle old configurations where 'NameIDPolicy' was used to specify just the format
-            $policy = array('Format' => $nameIdPolicy);
+            $policy = ['Format' => $nameIdPolicy];
         } elseif (is_array($nameIdPolicy)) {
             // handle current configurations specifying an array in the NameIDPolicy config option
             $nameIdPolicy_cf = \SimpleSAML_Configuration::loadFromArray($nameIdPolicy);
-            $policy = array(
+            $policy = [
                 'Format'      => $nameIdPolicy_cf->getString('Format', \SAML2\Constants::NAMEID_TRANSIENT),
                 'AllowCreate' => $nameIdPolicy_cf->getBoolean('AllowCreate', true),
-            );
+            ];
             $spNameQualifier = $nameIdPolicy_cf->getString('SPNameQualifier', false);
             if ($spNameQualifier !== false) {
                 $policy['SPNameQualifier'] = $spNameQualifier;
             }
         } elseif ($nameIdPolicy === null) {
             // when NameIDPolicy is unset or set to null, default to transient as before
-            $policy = array('Format' => \SAML2\Constants::NAMEID_TRANSIENT);
+            $policy = ['Format' => \SAML2\Constants::NAMEID_TRANSIENT];
         }
 
         return $policy;
diff --git a/modules/saml/lib/Auth/Source/SP.php b/modules/saml/lib/Auth/Source/SP.php
index 791fe7621..ccb94d748 100644
--- a/modules/saml/lib/Auth/Source/SP.php
+++ b/modules/saml/lib/Auth/Source/SP.php
@@ -237,7 +237,7 @@ class SP extends Source
             } elseif (is_array($state['saml:NameIDPolicy'])) {
                 $policy = $state['saml:NameIDPolicy'];
             } elseif ($state['saml:NameIDPolicy'] === null) {
-                $policy = array('Format' => \SAML2\Constants::NAMEID_TRANSIENT);
+                $policy = ['Format' => \SAML2\Constants::NAMEID_TRANSIENT];
             }
             if ($policy !== null) {
                 $ar->setNameIdPolicy($policy);
-- 
GitLab