mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Rewrite ugly if-else one-liners as ternary operator
This commit is contained in:
@ -343,8 +343,8 @@ function add_device()
|
|||||||
$message = "Missing the device hostname";
|
$message = "Missing the device hostname";
|
||||||
}
|
}
|
||||||
$hostname = $data['hostname'];
|
$hostname = $data['hostname'];
|
||||||
if ($data['port']) { $port = mres($data['port']); } else { $port = $config['snmp']['port']; }
|
$port = $data['port'] ? mres($data['port']) : $config['snmp']['port'];
|
||||||
if ($data['transport']) { $transport = mres($data['transport']); } else { $transport = "udp"; }
|
$transport = $data['transport'] ? mres($data['transport'] : "udp";
|
||||||
if($data['version'] == "v1" || $data['version'] == "v2c")
|
if($data['version'] == "v1" || $data['version'] == "v2c")
|
||||||
{
|
{
|
||||||
if ($data['community'])
|
if ($data['community'])
|
||||||
|
Reference in New Issue
Block a user