diff plugins/libcalendaring/libvcalendar.php @ 58:082a19037887 default tip

More cleaning up php8 Warnings/deprecations
author Charlie Root
date Wed, 15 Oct 2025 14:06:01 -0400
parents 91f005a4f7e9
children
line wrap: on
line diff
--- a/plugins/libcalendaring/libvcalendar.php	Wed Oct 08 09:33:13 2025 -0400
+++ b/plugins/libcalendaring/libvcalendar.php	Wed Oct 15 14:06:01 2025 -0400
@@ -1380,17 +1380,21 @@
 
     /*** Implement PHP 5 Iterator interface to make foreach work ***/
 
-    function current()
+    function current(): mixed
     {
         return $this->objects[$this->iteratorkey];
     }
 
-    function key()
+    function key(): mixed
     {
         return $this->iteratorkey;
     }
 
+    #[ReturnTypeWillChange]
     function next()
+    # HST: should be void per Iterator, but returns a value, and e.g.
+    # libcalendaring_recurrence uses it:
+    # 146:            while (($next = $this->next()
     {
         $this->iteratorkey++;
 
@@ -1402,12 +1406,12 @@
         return $this->valid();
     }
 
-    function rewind()
+    function rewind(): void
     {
         $this->iteratorkey = 0;
     }
 
-    function valid()
+    function valid(): bool
     {
         return !empty($this->objects[$this->iteratorkey]);
     }