diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/DHCPServer.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/DHCPServer.inc index aed01c2e3..6bd74ef95 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/DHCPServer.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Models/DHCPServer.inc @@ -224,7 +224,7 @@ class DHCPServer extends Model { allow_empty: true, help_text: 'Static mappings applied to this DHCP server.', ); - + # Ensure all interfaces have DHCP server objects initialized $this->init_interfaces(); @@ -237,14 +237,14 @@ class DHCPServer extends Model { private function init_interfaces(): void { # Variables $ifs_using_dhcpd = array_keys($this->get_config(path: $this->config_path, default: [])); - + # Loop through each defined interface foreach (NetworkInterface::read_all()->model_objects as $if) { # Skip this interface if it is not a static interface or the subnet value is greater than or equal to 31 - if ($if->typev4->value !== "static" or $if->subnet->value >= 31) { + if ($if->typev4->value !== 'static' or $if->subnet->value >= 31) { continue; } - + # Otherwise, make this interface eligible for a DHCP server if (!in_array($if->id, $ifs_using_dhcpd)) { $this->set_config(path: "$this->config_path/$if->id", value: []); diff --git a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsHAProxySettingsTestCase.inc b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsHAProxySettingsTestCase.inc index a2f08eb55..af10a9ead 100644 --- a/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsHAProxySettingsTestCase.inc +++ b/pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsHAProxySettingsTestCase.inc @@ -107,10 +107,10 @@ class APIModelsHAProxySettingsTestCase extends TestCase { */ public function test_localstats_refreshtime(): void { $haproxy_settings = new HAProxySettings( - enable: true, - localstats_refreshtime: 20, - localstatsport: "45454", - async: false + enable: true, + localstats_refreshtime: 20, + localstatsport: '45454', + async: false, ); $haproxy_settings->update(apply: true); $haproxy_cfg = new Command('cat /var/etc/haproxy/haproxy.cfg', trim_whitespace: true); @@ -119,8 +119,8 @@ class APIModelsHAProxySettingsTestCase extends TestCase { $haproxy_settings = new HAProxySettings( enable: true, localstats_refreshtime: 10, - localstatsport: "45454", - async: false + localstatsport: '45454', + async: false, ); $haproxy_settings->update(apply: true); $haproxy_cfg = new Command('cat /var/etc/haproxy/haproxy.cfg', trim_whitespace: true);