mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
PHPStan fixes (#13038)
* PHPStan fixes mostly type fixes semi-risky changes in availability map widget, tested a bit * fix style * Style fix * restore spaces stupid editor removed * fix the rest * device model back * remove ignores * introduce variable
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Ipv4Address;
|
||||
use App\Models\Ipv4Network;
|
||||
use App\Models\Port;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use LibreNMS\Util\IPv4;
|
||||
|
||||
@@ -29,10 +31,14 @@ class Ipv4AddressFactory extends Factory
|
||||
'ipv4_address' => $ip->uncompressed(),
|
||||
'ipv4_prefixlen' => $prefix,
|
||||
'port_id' => function () {
|
||||
return \App\Models\Port::factory()->create()->port_id;
|
||||
$port = Port::factory()->create(); /** @var Port $port */
|
||||
|
||||
return $port->port_id;
|
||||
},
|
||||
'ipv4_network_id' => function () use ($ip) {
|
||||
return \App\Models\Ipv4Network::factory()->create(['ipv4_network' => $ip->getNetworkAddress() . '/' . $ip->cidr])->ipv4_network_id;
|
||||
$ipv4 = Ipv4Network::factory()->create(['ipv4_network' => $ip->getNetworkAddress() . '/' . $ip->cidr]); /** @var Ipv4Address $ipv4 */
|
||||
|
||||
return $ipv4->ipv4_network_id;
|
||||
},
|
||||
];
|
||||
}
|
||||
|
Reference in New Issue
Block a user