mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Use Collection instead of collect() (#14527)
* Use Collection instead of collect() * wip
This commit is contained in:
@@ -32,6 +32,7 @@ use App\Models\OspfInstance;
|
||||
use App\Models\OspfNbr;
|
||||
use App\Models\OspfPort;
|
||||
use App\Observers\ModuleModelObserver;
|
||||
use Illuminate\Support\Collection;
|
||||
use LibreNMS\Interfaces\Module;
|
||||
use LibreNMS\OS;
|
||||
use LibreNMS\RRD\RrdDefinition;
|
||||
@@ -69,7 +70,7 @@ class Ospf implements Module
|
||||
->hideMib()->enumStrings()
|
||||
->walk('OSPF-MIB::ospfGeneralGroup')->valuesByIndex();
|
||||
|
||||
$ospf_instances = collect();
|
||||
$ospf_instances = new Collection();
|
||||
foreach ($ospf_instances_poll as $ospf_instance_id => $ospf_entry) {
|
||||
if (empty($ospf_entry['ospfRouterId'])) {
|
||||
continue; // skip invalid data
|
||||
|
@@ -142,7 +142,7 @@ class PrinterSupplies implements Module
|
||||
|
||||
private function discoveryLevels($device): Collection
|
||||
{
|
||||
$levels = collect();
|
||||
$levels = new Collection();
|
||||
|
||||
$oids = snmpwalk_cache_oid($device, 'prtMarkerSuppliesLevel', [], 'Printer-MIB');
|
||||
if (! empty($oids)) {
|
||||
@@ -212,7 +212,7 @@ class PrinterSupplies implements Module
|
||||
private function discoveryPapers($device): Collection
|
||||
{
|
||||
echo 'Tray Paper Level: ';
|
||||
$papers = collect();
|
||||
$papers = new Collection();
|
||||
|
||||
$tray_oids = snmpwalk_cache_oid($device, 'prtInputName', [], 'Printer-MIB');
|
||||
if (! empty($tray_oids)) {
|
||||
|
Reference in New Issue
Block a user