summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Schneider2021-07-25 14:14:25 +0200
committerChristian Schneider2021-07-25 14:14:25 +0200
commit087155dad0dd309dd3021244a23385635dae2682 (patch)
tree55640af1374c928d48bd72a5e25e17746af201bc
parentf4512248dfaee789c24ae7cf506f89b3d81e19e8 (diff)
downloaditools-087155dad0dd309dd3021244a23385635dae2682.tar.gz
itools-087155dad0dd309dd3021244a23385635dae2682.tar.bz2
itools-087155dad0dd309dd3021244a23385635dae2682.zip
Fix PHP 8.1 warnings
-rw-r--r--it.class2
-rw-r--r--it_dbi.class6
-rw-r--r--it_pipe.class5
3 files changed, 12 insertions, 1 deletions
diff --git a/it.class b/it.class
index 4ef56b6..493a85f 100644
--- a/it.class
+++ b/it.class
@@ -1039,7 +1039,7 @@ static function date($format = "", $stamp = null)
$formatstring = $format;
}
- return date($formatstring, $stamp);
+ return date($formatstring, intval($stamp));
}
# Internal: Convert expression or funcname or function literal to callable
diff --git a/it_dbi.class b/it_dbi.class
index ce2e8c0..8696ead 100644
--- a/it_dbi.class
+++ b/it_dbi.class
@@ -1020,21 +1020,25 @@ static function _state_purgeshared($dbid = null)
# Implement PHP 5 Iterator interface to make foreach work
# Example: foreach (new T_User('firstname' => "foo") as $foouser) { ... }
#
+#[ReturnTypeWillChange]
function current()
{
return $this;
}
+#[ReturnTypeWillChange]
function key()
{
return isset($this->_key) ? $this->_key : $this->_iteratorkey++;
}
+#[ReturnTypeWillChange]
function next()
{
$this->iterate();
}
+#[ReturnTypeWillChange]
function rewind()
{
if (!$this->_result) # Object without query used in foreach
@@ -1048,6 +1052,7 @@ function rewind()
$this->iterate();
}
+#[ReturnTypeWillChange]
function valid()
{
return (bool)$this->_data;
@@ -1089,6 +1094,7 @@ function _escape_name($str)
}
function _connect_db($p) {
+ mysqli_report(MYSQLI_REPORT_OFF); # it_dbi does not want exceptions for syntax errors
$result = @mysqli_connect($p['server'], $p['user'], $p['pw']);
if ($result)
diff --git a/it_pipe.class b/it_pipe.class
index 94801c3..0c112d9 100644
--- a/it_pipe.class
+++ b/it_pipe.class
@@ -49,26 +49,31 @@ function __toString()
#
# Internal: Implement iterator
#
+#[ReturnTypeWillChange]
function rewind()
{
$this->_position = 0;
}
+#[ReturnTypeWillChange]
function next()
{
$this->_position++;
}
+#[ReturnTypeWillChange]
function valid()
{
return array_key_exists($this->_position, $this->lines);
}
+#[ReturnTypeWillChange]
function current()
{
return $this->lines[$this->_position];
}
+#[ReturnTypeWillChange]
function key()
{
return $this->_position;