src: style sweep

This commit is contained in:
Franco Fichtner 2023-10-13 08:42:08 +02:00
parent 5a125dcb83
commit 55204f9d77
4 changed files with 8 additions and 9 deletions

View File

@ -3925,7 +3925,6 @@ function interfaces_neighbors_configure($device = null, $ifconfig_details = null
}
}
}
}
function get_interfaces_info($include_unlinked = false)

View File

@ -28,7 +28,6 @@
namespace OPNsense\Core;
class FileObject
{
private $fhandle = null;
@ -42,7 +41,7 @@ class FileObject
*/
public function __construct($filename, $mode, $permissions = null, $operation = null)
{
$this->fhandle = fopen($filename, $mode . 'e'); /* always add close-on-exec flag to prevent fork inherit */
$this->fhandle = fopen($filename, $mode . 'e'); /* always add close-on-exec flag to prevent fork inherit */
if ($permissions != null) {
@chmod($filename, $permissions);
@ -144,4 +143,4 @@ class FileObject
{
return $this->write(json_encode($data));
}
}
}

View File

@ -35,7 +35,6 @@ use ReflectionException;
use OPNsense\Base\FieldTypes\ArrayField;
use OPNsense\Base\FieldTypes\TextField;
class NeighborField extends ArrayField
{
protected static $internalStaticChildren = [];
@ -71,7 +70,10 @@ class NeighborField extends ArrayField
}
} catch (\Error | \Exception | ReflectionException $e) {
syslog(LOG_ERR, sprintf(
"Invalid neightbor object %s in %s (%s)", $classname, realpath($filename), $e->getMessage()
"Invalid neightbor object %s in %s (%s)",
$classname,
realpath($filename),
$e->getMessage()
));
}
}

View File

@ -32,7 +32,6 @@ namespace OPNsense\Interfaces\Neighbor;
use OPNsense\Core\Config;
class dhcpd
{
public function collect()
@ -44,7 +43,7 @@ class dhcpd
foreach ($config->dhcpd->children() as $intf => $node) {
foreach ($node->children() as $key => $data) {
if ($key == 'staticmap') {
if (!empty($data->arp_table_static_entry) || !empty($node->staticarp) ) {
if (!empty($data->arp_table_static_entry) || !empty($node->staticarp)) {
$result[] = [
'etheraddr' => (string)$data->mac,
'ipaddress' => (string)$data->ipaddr,
@ -58,4 +57,4 @@ class dhcpd
}
return $result;
}
}
}