Issues (2963)

includes/polling/os/areca.inc.php (1 issue)

1
<?php
2
3
$hardware = trim(snmp_get($device, '1.3.6.1.4.1.18928.1.1.1.1.0', '-OQv', '', ''), '"');
0 ignored issues
show
It seems like snmp_get($device, '1.3.6...1.1.0', '-OQv', '', '') can also be of type false; however, parameter $string of trim() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

3
$hardware = trim(/** @scrutinizer ignore-type */ snmp_get($device, '1.3.6.1.4.1.18928.1.1.1.1.0', '-OQv', '', ''), '"');
Loading history...
4
if (! $hardware) {
5
    $hardware = trim(snmp_get($device, '1.3.6.1.4.1.18928.1.2.1.1.0', '-OQv', '', ''), '"');
6
}
7
8
$version = trim(snmp_get($device, '1.3.6.1.4.1.18928.1.1.1.4.0', '-OQv', '', ''), '"');
9
if (! $version) {
10
    $version = trim(snmp_get($device, '1.3.6.1.4.1.18928.1.2.1.4.0', '-OQv', '', ''), '"');
11
}
12
13
$serial = trim(snmp_get($device, '1.3.6.1.4.1.18928.1.1.1.3.0', '-OQv', '', ''), '"');
14
if (! $serial) {
15
    $serial = trim(snmp_get($device, '1.3.6.1.4.1.18928.1.2.1.3.0', '-OQv', '', ''), '"');
16
}
17
18
if (isHexString($serial)) {
19
    // Sometimes firmware outputs serial as hex-string
20
    $serial = snmp_hexstring($serial);
21
}
22