Miscellaneous fixes, mostly undefined variables (#14432)

* Miscellaneous fixes, mostly undefined variables

* Update phpstan-baseline.neon
This commit is contained in:
Jellyfrog
2022-10-11 11:30:00 +02:00
committed by GitHub
parent 071173ffb9
commit be1a2cec50
23 changed files with 50 additions and 38 deletions

View File

@@ -44,7 +44,7 @@ class ThreeCom extends OS implements OSDiscovery
$device->hardware = str_replace('3Com ', '', $device->sysDescr);
// Old Stack Units
if (Str::startsWith($device->sysObjectID, '.1.3.6.1.4.1.43.10.27.4.1.')) {
if (Str::startsWith($device->sysObjectID ?? '', '.1.3.6.1.4.1.43.10.27.4.1.')) {
$oids = ['stackUnitDesc.1', 'stackUnitPromVersion.1', 'stackUnitSWVersion.1', 'stackUnitSerialNumber.1', 'stackUnitCapabilities.1'];
$data = snmp_get_multi($this->getDeviceArray(), $oids, ['-OQUs', '--hexOutputLength=0'], 'A3COM0352-STACK-CONFIG');
$device->hardware = trim($device->hardware . ' ' . ($data[1]['stackUnitDesc'] ?? ''));