library: some hints for PHP 8.1

This commit is contained in:
Thomas Gelf 2021-12-01 23:50:04 +01:00
parent b7c0559212
commit 215988c3ca
4 changed files with 10 additions and 1 deletions

View File

@ -82,6 +82,7 @@ class SerializableValue implements Serializable
return gettype($var);
}
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return $this->value;

View File

@ -2,6 +2,7 @@
namespace Icinga\Module\Director\Db\Branch;
use gipfl\Translation\StaticTranslator;
use gipfl\Translation\TranslationHelper;
use Icinga\Module\Director\Db;
use ipl\Html\Html;
@ -56,7 +57,7 @@ class BranchModificationInspection
public static function describeModificationStatistics($stats)
{
$t = TranslationHelper::getTranslator();
$t = StaticTranslator::get();
$relevantStats = [];
if ($stats->cnt_created > 0) {
$relevantStats[] = sprintf($t->translate('%d created'), $stats->cnt_created);

View File

@ -27,11 +27,13 @@ class IcingaScheduledDowntimeRanges implements Iterator, Countable, IcingaConfig
$this->object = $object;
}
#[\ReturnTypeWillChange]
public function count()
{
return count($this->ranges);
}
#[\ReturnTypeWillChange]
public function rewind()
{
$this->position = 0;
@ -42,6 +44,7 @@ class IcingaScheduledDowntimeRanges implements Iterator, Countable, IcingaConfig
return $this->modified;
}
#[\ReturnTypeWillChange]
public function current()
{
if (! $this->valid()) {
@ -51,16 +54,19 @@ class IcingaScheduledDowntimeRanges implements Iterator, Countable, IcingaConfig
return $this->ranges[$this->idx[$this->position]];
}
#[\ReturnTypeWillChange]
public function key()
{
return $this->idx[$this->position];
}
#[\ReturnTypeWillChange]
public function next()
{
++$this->position;
}
#[\ReturnTypeWillChange]
public function valid()
{
return array_key_exists($this->position, $this->idx);

View File

@ -212,6 +212,7 @@ abstract class QuickTable implements Paginatable, ValidHtml
return $paginator;
}
#[\ReturnTypeWillChange]
public function count()
{
$db = $this->db();