Skip to content

Commit

Permalink
style: ran prettier on changed files
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhendrickson13 committed Apr 24, 2024
1 parent b49220c commit 8e34317
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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: []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 8e34317

Please sign in to comment.