2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

More php8 compat fixes

This commit is contained in:
Adam Zammit
2023-04-26 16:28:14 +10:00
parent fb74ee3c65
commit 7e202234f3
24 changed files with 88 additions and 62 deletions

View File

@@ -203,7 +203,7 @@ class Calendar
*
* @access protected
*/
function Calendar($y = 2000, $m = 1, $d = 1, $h = 0, $i = 0, $s = 0)
function __construct($y = 2000, $m = 1, $d = 1, $h = 0, $i = 0, $s = 0)
{
static $cE = null;
if (!isset($cE)) {
@@ -392,6 +392,19 @@ class Calendar
return false;
}
function legacy_each($array){
$key = key($array);
$value = current($array);
$each = is_null($key) ? false : [
1 => $value,
'value' => $value,
0 => $key,
'key' => $key,
];
next($array);
return $each;
}
/**
* Iterator method for fetching child Calendar subclass objects
* (e.g. a minute from an hour object). On reaching the end of
@@ -403,7 +416,7 @@ class Calendar
*/
function fetch()
{
$child = each($this->children);
$child = $this->legacy_each($this->children);
if ($child) {
return $child['value'];
} else {