Use Collection instead of collect() (#14527)

* Use Collection instead of collect()

* wip
This commit is contained in:
Jellyfrog
2022-11-05 10:04:36 +01:00
committed by GitHub
parent e5e169358f
commit 009d69a48d
21 changed files with 60 additions and 46 deletions

View File

@@ -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

View File

@@ -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)) {