1 | <?php |
||
2 | |||
3 | $datasetTable_array = snmpwalk_cache_oid($device, 'datasetTable', null, 'FREENAS-MIB'); |
||
0 ignored issues
–
show
|
|||
4 | |||
5 | $sql = "SELECT `storage_descr` FROM `storage` WHERE `device_id` = '" . $device['device_id'] . "' AND `storage_type` != 'dataset'"; |
||
6 | $tmp_storage = dbFetchColumn($sql); |
||
7 | |||
8 | if (is_array($datasetTable_array)) { |
||
0 ignored issues
–
show
|
|||
9 | foreach ($datasetTable_array as $index => $dataset) { |
||
10 | if (isset($dataset['datasetDescr'])) { |
||
11 | if (! in_array($dataset['datasetDescr'], $tmp_storage)) { |
||
12 | $dataset['datasetIndex'] = $index; |
||
13 | $dataset['datasetTotal'] = $dataset['datasetSize'] * $dataset['datasetAllocationUnits']; |
||
14 | $dataset['datasetAvail'] = ($dataset['datasetAvailable'] * $dataset['datasetAllocationUnits']); |
||
15 | $dataset['datasetUsed'] = $dataset['datasetTotal'] - $dataset['datasetAvail']; |
||
16 | |||
17 | discover_storage($valid_storage, $device, $dataset['datasetIndex'], 'dataset', 'freenas-dataset', $dataset['datasetDescr'], $dataset['datasetTotal'], $dataset['datasetAllocationUnits'], $dataset['datasetUsed']); |
||
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.