diff --git a/src/etc/inc/plugins.inc.d/openvpn.inc b/src/etc/inc/plugins.inc.d/openvpn.inc index 1e089d6af..f236cb8ce 100644 --- a/src/etc/inc/plugins.inc.d/openvpn.inc +++ b/src/etc/inc/plugins.inc.d/openvpn.inc @@ -1490,13 +1490,10 @@ function openvpn_get_interface_ip($ip, $mask) // Special case for /31 networks which lack network and broadcast addresses. // As per RFC3021, both addresses should be treated as host addresses. - if ($masklong == 0xfffffffe) - { + if ($masklong == 0xfffffffe) { $ip1 = long2ip32($baselong); $ip2 = long2ip32($baselong + 1); - } - else - { + } else { $ip1 = long2ip32($baselong + 1); $ip2 = long2ip32($baselong + 2); } diff --git a/src/opnsense/mvc/app/controllers/OPNsense/Base/UserException.php b/src/opnsense/mvc/app/controllers/OPNsense/Base/UserException.php index 3252fca45..b9fd7838e 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/Base/UserException.php +++ b/src/opnsense/mvc/app/controllers/OPNsense/Base/UserException.php @@ -28,12 +28,12 @@ */ namespace OPNsense\Base; - class UserException extends \Exception { private $title = null; - public function __construct($message = "", $title = "", $code = 0, Exception $previous = null) { + public function __construct($message = "", $title = "", $code = 0, Exception $previous = null) + { $this->title = $title; parent::__construct($message, $code, $previous); } @@ -45,5 +45,4 @@ class UserException extends \Exception { return $this->title; } - -} \ No newline at end of file +} diff --git a/src/opnsense/mvc/app/library/OPNsense/Firewall/Rule.php b/src/opnsense/mvc/app/library/OPNsense/Firewall/Rule.php index ab2abd638..3a149ebde 100644 --- a/src/opnsense/mvc/app/library/OPNsense/Firewall/Rule.php +++ b/src/opnsense/mvc/app/library/OPNsense/Firewall/Rule.php @@ -295,9 +295,9 @@ abstract class Rule { if (empty($value)) { return ''; - } else if (empty($this->interfaceMapping[$value]['if'])) { + } elseif (empty($this->interfaceMapping[$value]['if'])) { return "{$prefix}##{$value}##{$suffix} "; - } else if (!empty($this->interfaceMapping[$value]['ipaddrv6']) && + } elseif (!empty($this->interfaceMapping[$value]['ipaddrv6']) && ($this->interfaceMapping[$value]['ipaddrv6'] == '6rd' || $this->interfaceMapping[$value]['ipaddrv6'] == '6to4')) { return "{$prefix}". "{$value}_stf" ."{$suffix} "; diff --git a/src/opnsense/mvc/app/library/OPNsense/Firewall/Util.php b/src/opnsense/mvc/app/library/OPNsense/Firewall/Util.php index 375077c07..51a4aa001 100644 --- a/src/opnsense/mvc/app/library/OPNsense/Firewall/Util.php +++ b/src/opnsense/mvc/app/library/OPNsense/Firewall/Util.php @@ -77,7 +77,7 @@ class Util */ public static function isAlias($name) { - if (!empty($name) ){ + if (!empty($name)) { $aliasMdl = new Alias(); // MVC defined aliases foreach ($aliasMdl->aliases->alias->__items as $alias) { diff --git a/src/opnsense/mvc/app/models/OPNsense/Base/Validators/CallbackValidator.php b/src/opnsense/mvc/app/models/OPNsense/Base/Validators/CallbackValidator.php index a1bf778ec..20f860866 100644 --- a/src/opnsense/mvc/app/models/OPNsense/Base/Validators/CallbackValidator.php +++ b/src/opnsense/mvc/app/models/OPNsense/Base/Validators/CallbackValidator.php @@ -64,7 +64,8 @@ class CallbackValidator extends Validator implements ValidatorInterface } else { // dropout with validation error when we miss a callback $validator->appendMessage( - new Message(gettext("Configuration error, missing callback in CallbackValidator"), + new Message( + gettext("Configuration error, missing callback in CallbackValidator"), $attribute, 'CallbackValidator' ) diff --git a/src/opnsense/mvc/app/models/OPNsense/Firewall/Alias.php b/src/opnsense/mvc/app/models/OPNsense/Firewall/Alias.php index 55abf3638..6c5e3a0b7 100644 --- a/src/opnsense/mvc/app/models/OPNsense/Firewall/Alias.php +++ b/src/opnsense/mvc/app/models/OPNsense/Firewall/Alias.php @@ -84,7 +84,7 @@ class Alias extends BaseModel $cfgsection = $cfgsection->$cfgName; } if ($cfgsection != null) { - $nodeidx = 0 ; + $nodeidx = 0; foreach ($cfgsection as $inode) { $node = $inode; foreach ($aliasref[1] as $cfgName) { diff --git a/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/AliasContentField.php b/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/AliasContentField.php index a4495c8dc..194827d1b 100644 --- a/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/AliasContentField.php +++ b/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/AliasContentField.php @@ -117,7 +117,8 @@ class AliasContentField extends BaseField foreach ($this->getItems($data) as $port) { if (!Util::isAlias($port) && !Util::isPort($port, true)) { $messages[] = sprintf( - gettext('Entry "%s" is not a valid port number.'), $port + gettext('Entry "%s" is not a valid port number.'), + $port ); } } @@ -135,7 +136,8 @@ class AliasContentField extends BaseField foreach ($this->getItems($data) as $host) { if (!Util::isAlias($host) && !Util::isIpAddress($host) && !Util::isDomain($host)) { $messages[] = sprintf( - gettext('Entry "%s" is not a valid hostname or IP address.'), $host + gettext('Entry "%s" is not a valid hostname or IP address.'), + $host ); } } @@ -163,7 +165,8 @@ class AliasContentField extends BaseField if (!Util::isAlias($network) && !Util::isIpAddress($network) && !Util::isSubnet($network) && !($ipaddr_count == 2 && $domain_alias_count == 0)) { $messages[] = sprintf( - gettext('Entry "%s" is not a valid hostname or IP address.'), $network + gettext('Entry "%s" is not a valid hostname or IP address.'), + $network ); } } diff --git a/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/AliasNameField.php b/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/AliasNameField.php index dc575e708..de307df8a 100644 --- a/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/AliasNameField.php +++ b/src/opnsense/mvc/app/models/OPNsense/Firewall/FieldTypes/AliasNameField.php @@ -33,7 +33,6 @@ use OPNsense\Base\Validators\CallbackValidator; use Phalcon\Validation\Validator\Regex; use Phalcon\Validation\Validator\ExclusionIn; - /** * Class AliasNameField * @package OPNsense\Base\FieldTypes diff --git a/src/opnsense/mvc/app/models/OPNsense/Firewall/Migrations/M1_0_0.php b/src/opnsense/mvc/app/models/OPNsense/Firewall/Migrations/M1_0_0.php index 1a2389966..0240b5e1b 100644 --- a/src/opnsense/mvc/app/models/OPNsense/Firewall/Migrations/M1_0_0.php +++ b/src/opnsense/mvc/app/models/OPNsense/Firewall/Migrations/M1_0_0.php @@ -62,14 +62,14 @@ class M1_0_0 extends BaseModelMigration if ($alias->url) { // url content only contains a single item $node->content = (string)$alias->url; - } elseif ($alias->aliasurl){ + } elseif ($alias->aliasurl) { // aliasurl in legacy config could consist of multiple entries $content = array(); foreach ($alias->aliasurl as $url) { $content[] = (string)$url; } $node->content = implode("\n", $content); - } elseif ($alias->address){ + } elseif ($alias->address) { // address entries $node->content = str_replace(" ", "\n", (string)$alias->address); }