mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 08:44:11 +02:00
Director: some PHP 8.1-related changes
This commit is contained in:
parent
ac575858dc
commit
82656de2c2
@ -93,7 +93,8 @@ class SyncPropertyForm extends DirectorObjectForm
|
||||
$this->setElementValue('use_filter', $useFilter = 'n');
|
||||
}
|
||||
} else {
|
||||
$useFilter = strlen($this->getObject()->filter_expression) ? 'y' : 'n';
|
||||
$expression = $this->getObject()->filter_expression;
|
||||
$useFilter = ($expression === null || strlen($expression) === 0) ? 'n' : 'y';
|
||||
$this->setElementValue('use_filter', $useFilter);
|
||||
}
|
||||
|
||||
|
@ -284,7 +284,7 @@ class IcingaConfigHelper
|
||||
return null;
|
||||
}
|
||||
|
||||
if (ctype_digit($interval)) {
|
||||
if (is_int($interval) || ctype_digit($interval)) {
|
||||
return (int) $interval;
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ class Sync
|
||||
$this->hasPropertyDisabled = true;
|
||||
}
|
||||
|
||||
if (! strlen($prop->get('filter_expression'))) {
|
||||
if ($prop->get('filter_expression') === null || strlen($prop->get('filter_expression')) === 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -30,11 +30,13 @@ class IcingaArguments implements Iterator, Countable, IcingaConfigRenderer
|
||||
$this->object = $object;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function count()
|
||||
{
|
||||
return count($this->arguments);
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function rewind()
|
||||
{
|
||||
$this->position = 0;
|
||||
@ -45,6 +47,7 @@ class IcingaArguments implements Iterator, Countable, IcingaConfigRenderer
|
||||
return $this->modified;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function current()
|
||||
{
|
||||
if (! $this->valid()) {
|
||||
@ -54,16 +57,19 @@ class IcingaArguments implements Iterator, Countable, IcingaConfigRenderer
|
||||
return $this->arguments[$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);
|
||||
|
@ -57,11 +57,13 @@ class IcingaObjectMultiRelations implements Iterator, Countable, IcingaConfigRen
|
||||
return $this->relations;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function count()
|
||||
{
|
||||
return count($this->relations);
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function rewind()
|
||||
{
|
||||
$this->position = 0;
|
||||
@ -72,6 +74,7 @@ class IcingaObjectMultiRelations implements Iterator, Countable, IcingaConfigRen
|
||||
return $this->modified;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function current()
|
||||
{
|
||||
if (! $this->valid()) {
|
||||
@ -81,16 +84,19 @@ class IcingaObjectMultiRelations implements Iterator, Countable, IcingaConfigRen
|
||||
return $this->relations[$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);
|
||||
|
@ -30,11 +30,13 @@ class IcingaTimePeriodRanges implements Iterator, Countable, IcingaConfigRendere
|
||||
$this->object = $object;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function count()
|
||||
{
|
||||
return count($this->ranges);
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function rewind()
|
||||
{
|
||||
$this->position = 0;
|
||||
@ -45,6 +47,7 @@ class IcingaTimePeriodRanges implements Iterator, Countable, IcingaConfigRendere
|
||||
return $this->modified;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function current()
|
||||
{
|
||||
if (! $this->valid()) {
|
||||
@ -54,16 +57,19 @@ class IcingaTimePeriodRanges implements Iterator, Countable, IcingaConfigRendere
|
||||
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);
|
||||
|
@ -31,7 +31,7 @@ class DatafieldCategoryTable extends ZfQueryBasedTable
|
||||
['name' => $row->category_name]
|
||||
)];
|
||||
|
||||
if (strlen($row->description)) {
|
||||
if ($row->description !== null && strlen($row->description)) {
|
||||
$main[] = Html::tag('br');
|
||||
$main[] = Html::tag('small', $row->description);
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ class ImportSourceDetails extends HtmlDocument
|
||||
{
|
||||
$source = $this->source;
|
||||
$description = $source->get('description');
|
||||
if (strlen($description)) {
|
||||
if ($description !== null && strlen($description)) {
|
||||
$this->add(Html::tag('p', null, $description));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user