Minor: standardize comment header, declare strict_types=1

This commit is contained in:
billz
2025-07-20 02:08:33 -07:00
parent cbc6ee74c3
commit 9df3baa5f1
4 changed files with 29 additions and 16 deletions

View File

@@ -1,12 +1,19 @@
<?php
/**
* A dhcpcd configuration class for RaspAP
*
* @description Handles building, saving and safe updating of dhcpcd configs
* @author Bill Zimmerman <billzimmerman@gmail.com>
* @license https://github.com/raspap/raspap-webgui/blob/master/LICENSE
*/
declare(strict_types=1);
namespace RaspAP\Networking\Hotspot;
use RaspAP\Messages\StatusMessage;
/**
* Handles dhcpcd.conf interface configuration.
*/
class DhcpcdManager
{
private const CONF_DEFAULT = RASPI_DHCPCD_CONFIG;
@@ -99,6 +106,7 @@ class DhcpcdManager
);
}
$dhcp_cfg = file_get_contents(SELF::CONF_DEFAULT);
$skip_dhcp = false;
if (preg_match('/wlan[3-9]\d*|wlan[1-9]\d+/', $ap_iface)) {
$skip_dhcp = true;
@@ -280,8 +288,7 @@ class DhcpcdManager
$lines = [];
exec('cat ' . escapeshellarg($dnsmasqFile), $lines);
if (!function_exists('ParseConfig')) {
// ensure legacy parser available
require_once RASPI_CONFIG . '/functions.php';
require_once 'includes/functions.php';
}
$conf = ParseConfig($lines);

View File

@@ -1,7 +1,5 @@
<?php
namespace RaspAP\Networking\Hotspot;
/**
* A dnsmasq configuration manager for RaspAP
*
@@ -10,6 +8,10 @@ namespace RaspAP\Networking\Hotspot;
* @license https://github.com/raspap/raspap-webgui/blob/master/LICENSE
*/
declare(strict_types=1);
namespace RaspAP\Networking\Hotspot;
class DnsmasqManager
{
private const CONF_SUFFIX = '.conf';
@@ -115,7 +117,6 @@ class DnsmasqManager
$configFile = RASPI_DNSMASQ_PREFIX . $iface . self::CONF_SUFFIX;
$tempFile = SELF::CONF_TMP;
$config = join(PHP_EOL, $config);
error_log('[DnsmasqManager::saveConfig] $config = ' . var_export($config, true));
file_put_contents($tempFile, $config);
$cmd = sprintf('sudo cp %s %s', escapeshellarg($tempFile), escapeshellarg($configFile));

View File

@@ -1,9 +1,5 @@
<?php
namespace RaspAP\Networking\Hotspot\Validators;
use RaspAP\Messages\StatusMessage;
/**
* Hostapd validator class for RaspAP
*
@@ -11,6 +7,13 @@ use RaspAP\Messages\StatusMessage;
* @author Bill Zimmerman <billzimmerman@gmail.com>
* @license https://github.com/raspap/raspap-webgui/blob/master/LICENSE
*/
declare(strict_types=1);
namespace RaspAP\Networking\Hotspot\Validators;
use RaspAP\Messages\StatusMessage;
class HostapdValidator
{

View File

@@ -1,14 +1,16 @@
<?php
namespace RaspAP\Networking\Hotspot;
/**
* Wireless utility class
* @description A collection of wireless utility methods for RaspAP
* A wireless utility class for RaspAP
* @description A collection of wireless utility methods
* @author Bill Zimmerman <billzimmerman@gmail.com>
* @license https://github.com/raspap/raspap-webgui/blob/master/LICENSE
*/
declare(strict_types=1);
namespace RaspAP\Networking\Hotspot;
class WiFiManager
{