src: style sweep

This commit is contained in:
Franco Fichtner 2022-06-08 13:53:58 +02:00
parent 09d782f8f5
commit 5dd573b6e4
2 changed files with 5 additions and 4 deletions

View File

@ -225,11 +225,11 @@ class Util
*/
private static function getservbyname($service, $protocol)
{
if (!isset(self::$servbynames[$protocol])){
if (!isset(self::$servbynames[$protocol])) {
self::$servbynames[$protocol] = [];
}
if (!isset(self::$servbynames[$protocol][$service])) {
self::$servbynames[$protocol][$service] = getservbyname($service, $protocol);
self::$servbynames[$protocol][$service] = getservbyname($service, $protocol);
}
return self::$servbynames[$protocol][$service];
}
@ -244,7 +244,8 @@ class Util
{
$tmp = explode(':', $number);
foreach ($tmp as $port) {
if ((filter_var($port, FILTER_VALIDATE_INT, array(
if (
(filter_var($port, FILTER_VALIDATE_INT, array(
"options" => array("min_range" => 1, "max_range" => 65535))) === false || !ctype_digit($port)) &&
!self::getservbyname($port, "tcp") && !self::getservbyname($port, "udp")
) {

View File

@ -216,7 +216,7 @@ class Alias extends BaseModel
if ($uuid === false) {
return null;
}
$alias = $this->getNodeByReference("aliases.alias.".$uuid);
$alias = $this->getNodeByReference('aliases.alias.' . $uuid);
if ($alias != null && (string)$alias->name == $name) {
return $alias;
}