Package: php-horde-logintasks / 2.0.7-8

1001_replace-deprecated-while-each-by-foreach.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Description: Drop usage of deprecated while...each loops and replace by foreach.
Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>

--- a/Horde_LoginTasks-2.0.7/lib/Horde/LoginTasks/Tasklist.php
+++ b/Horde_LoginTasks-2.0.7/lib/Horde/LoginTasks/Tasklist.php
@@ -99,8 +99,7 @@
             }
         }
 
-        reset($this->_tasks);
-        while (list($k, $v) = each($this->_tasks)) {
+        foreach ($this->_tasks as $k => $v) {
             if ($v->needsDisplay() && ($k >= $this->_ptr)) {
                 break;
             }
@@ -127,8 +126,7 @@
         $tmp = array();
         $previous = null;
 
-        reset($this->_tasks);
-        while (list(, $v) = each($this->_tasks)) {
+        foreach ($this->_tasks as $v) {
             if (!$v->needsDisplay() ||
                 (!is_null($previous) && !$v->joinDisplayWith($previous))) {
                 break;