mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 16:54:04 +02:00
Replace sizeof with count
Do not use sizeof to get the length of an array, as the function name 'sizeof' is misleading
This commit is contained in:
parent
d199a8b036
commit
010466f8f9
@ -101,14 +101,14 @@ class Inline {
|
|||||||
foreach ($this->data as $key => $value) {
|
foreach ($this->data as $key => $value) {
|
||||||
$this->data[$key] = (int)$value;
|
$this->data[$key] = (int)$value;
|
||||||
}
|
}
|
||||||
for ($i = 0; $i < sizeof($this->data); $i++) {
|
for ($i = 0; $i < count($this->data); $i++) {
|
||||||
$this->labels[] = '';
|
$this->labels[] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists('colors', $_GET)) {
|
if (array_key_exists('colors', $_GET)) {
|
||||||
$this->colors = $this->sanitizeStringArray(explode(',', $_GET['colors']));
|
$this->colors = $this->sanitizeStringArray(explode(',', $_GET['colors']));
|
||||||
}
|
}
|
||||||
while (sizeof($this->colors) < sizeof($this->data)) {
|
while (count($this->colors) < count($this->data)) {
|
||||||
$this->colors[] = '#FEFEFE';
|
$this->colors[] = '#FEFEFE';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ class Dns
|
|||||||
public static function ipv4($hostname)
|
public static function ipv4($hostname)
|
||||||
{
|
{
|
||||||
$records = dns_get_record($hostname, DNS_A);
|
$records = dns_get_record($hostname, DNS_A);
|
||||||
if ($records !== false && sizeof($records) > 0) {
|
if ($records !== false && count($records) > 0) {
|
||||||
return $records[0]['ip'];
|
return $records[0]['ip'];
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -117,7 +117,7 @@ class Dns
|
|||||||
public static function ipv6($hostname)
|
public static function ipv6($hostname)
|
||||||
{
|
{
|
||||||
$records = dns_get_record($hostname, DNS_AAAA);
|
$records = dns_get_record($hostname, DNS_AAAA);
|
||||||
if ($records !== false && sizeof($records) > 0) {
|
if ($records !== false && count($records) > 0) {
|
||||||
return $records[0]['ip'];
|
return $records[0]['ip'];
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -22,7 +22,7 @@ $pivotData = $this->pivot->toArray();
|
|||||||
$hostFilter = '(' . implode('|', array_keys($pivotData)) . ')';
|
$hostFilter = '(' . implode('|', array_keys($pivotData)) . ')';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if (sizeof($pivotData) === 0): ?>
|
<?php if (count($pivotData) === 0): ?>
|
||||||
<?= $this->translate('No Service Found'); ?>
|
<?= $this->translate('No Service Found'); ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user