From 85db9be770e3ff84a801d406c3aa30d9aa69954a Mon Sep 17 00:00:00 2001
From: David Siegfried <david.siegfried@uni-vechta.de>
Date: Mon, 8 May 2023 12:43:18 +0000
Subject: [PATCH] prevent php8-warnings, closes #2616

Closes #2616

Merge request studip/studip!1765
---
 lib/raumzeit/SingleDate.class.php | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/raumzeit/SingleDate.class.php b/lib/raumzeit/SingleDate.class.php
index 8909983a990..b867e4d829a 100644
--- a/lib/raumzeit/SingleDate.class.php
+++ b/lib/raumzeit/SingleDate.class.php
@@ -71,6 +71,7 @@ class SingleDate
     function __construct($data = '')
     {
         global $user, $id;
+        $termin_id = '';
         if ($data instanceOf CourseDate || $data instanceof CourseExDate) {
             $single_date_data = $data->toArray();
             $single_date_data['ex_termin'] = $data instanceOf CourseDate ? 0 : 1;
@@ -87,7 +88,7 @@ class SingleDate
             } else {
                 $termin_id = $data;
             }
-            if ($termin_id != '') {
+            if ($termin_id !== '') {
                 $this->termin_id = $termin_id;
                 $this->update = true;
                 $this->restore();
@@ -102,6 +103,10 @@ class SingleDate
         }
     }
 
+    public function __toString()
+    {
+        return $this->toString();
+    }
 
     function getStartTime()
     {
@@ -356,6 +361,7 @@ class SingleDate
 
     function isHoliday()
     {
+        $name = null;
         foreach (SemesterHoliday::getAll() as $val) {
             if (($val['beginn'] <= $this->date) && ($val['ende'] >= $this->end_time)) {
                 $name = $val['name'];
-- 
GitLab