From 73fc528c1c96e4a4a4610554b522f15a4998dfd3 Mon Sep 17 00:00:00 2001
From: Thijs Kinkhorst <thijs@kinkhorst.com>
Date: Thu, 6 Jan 2022 11:40:18 +0000
Subject: [PATCH] addContact: fix assertions for removed $type parameter

---
 lib/SimpleSAML/Metadata/SAMLBuilder.php | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/SimpleSAML/Metadata/SAMLBuilder.php b/lib/SimpleSAML/Metadata/SAMLBuilder.php
index 5376fee24..5d96cec41 100644
--- a/lib/SimpleSAML/Metadata/SAMLBuilder.php
+++ b/lib/SimpleSAML/Metadata/SAMLBuilder.php
@@ -630,10 +630,11 @@ class SAMLBuilder
      */
     public function addContact(array $details): void
     {
-        Assert::oneOf($type, ['technical', 'support', 'administrative', 'billing', 'other']);
+        Assert::notNull($details['contactType']);
+        Assert::oneOf($details['contactType'], ['technical', 'support', 'administrative', 'billing', 'other']);
 
         $e = new \SAML2\XML\md\ContactPerson();
-        $e->setContactType($type);
+        $e->setContactType($details['contactType']);
 
         if (!empty($details['attributes'])) {
             $e->setContactPersonAttributes($details['attributes']);
-- 
GitLab