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

@@ -89,7 +89,7 @@ class Calendar_Validator
*
* @access public
*/
function Calendar_Validator(&$calendar)
function __construct(&$calendar)
{
$this->calendar = & $calendar;
$this->cE = & $calendar->getEngine();
@@ -261,6 +261,19 @@ class Calendar_Validator
return true;
}
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;
}
/**
* Iterates over any validation errors
*
@@ -269,7 +282,7 @@ class Calendar_Validator
*/
function fetch()
{
$error = each($this->errors);
$error = $this->legacy_each($this->errors);
if ($error) {
return $error['value'];
} else {
@@ -323,7 +336,7 @@ class Calendar_Validation_Error
*
* @access protected
*/
function Calendar_Validation_Error($unit, $value, $message)
function __construct($unit, $value, $message)
{
$this->unit = $unit;
$this->value = $value;
@@ -374,4 +387,4 @@ class Calendar_Validation_Error
return $this->unit.' = '.$this->value.' ['.$this->message.']';
}
}
?>
?>