1 | <?php |
||
2 | |||
3 | $zpooltable_array = snmpwalk_cache_oid($device, 'zpoolTable', null, 'FREENAS-MIB'); |
||
0 ignored issues
–
show
|
|||
4 | |||
5 | $sql = "SELECT `storage_descr` FROM `storage` WHERE `device_id` = '" . $device['device_id'] . "' AND `storage_type` != 'zpool'"; |
||
6 | $tmp_storage = dbFetchColumn($sql); |
||
7 | |||
8 | if (is_array($zpooltable_array)) { |
||
0 ignored issues
–
show
|
|||
9 | foreach ($zpooltable_array as $index => $zpool) { |
||
10 | if (isset($zpool['zpoolDescr'])) { |
||
11 | if (! in_array($zpool['zpoolDescr'], $tmp_storage)) { |
||
12 | $zpool['zpoolIndex'] = $index; |
||
13 | $zpool['zpoolTotal'] = $zpool['zpoolSize'] * $zpool['zpoolAllocationUnits']; |
||
14 | $zpool['zpoolAvail'] = ($zpool['zpoolAvailable'] * $zpool['zpoolAllocationUnits']); |
||
15 | $zpool['zpoolUsed'] = $zpool['zpoolTotal'] - $zpool['zpoolAvail']; |
||
16 | |||
17 | discover_storage($valid_storage, $device, $zpool['zpoolIndex'], 'zpool', 'freenas-zpool', $zpool['zpoolDescr'], $zpool['zpoolTotal'], $zpool['zpoolAllocationUnits'], $zpool['zpoolUsed']); |
||
18 | } |
||
19 | } |
||
20 | } |
||
21 | } |
||
22 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.