diff --git a/lam/lib/baseModule.inc b/lam/lib/baseModule.inc index 030e18a05..5225953e1 100644 --- a/lam/lib/baseModule.inc +++ b/lam/lib/baseModule.inc @@ -2243,11 +2243,11 @@ abstract class baseModule { /** * Returns the {@link accountContainer} object. * - * @return accountContainer accountContainer object + * @return ?accountContainer accountContainer object * * @see accountContainer */ - protected function getAccountContainer() { + protected function getAccountContainer(): ?accountContainer { if (isset($this->base) && isset($_SESSION[$this->base])) { return $_SESSION[$this->base]; } diff --git a/lam/lib/modules/fixed_ip.inc b/lam/lib/modules/fixed_ip.inc index e6ddedb27..3265eb789 100644 --- a/lam/lib/modules/fixed_ip.inc +++ b/lam/lib/modules/fixed_ip.inc @@ -173,19 +173,19 @@ class fixed_ip extends baseModule { /** * * Check, if a mac address is invalid - * @param mac address + * @param string mac address * - * @return true, if mac is invalid + * @return bool true, if mac is invalid **/ - public function check_mac($mac) { + public function check_mac($mac): bool { $ex = explode(":", $mac); $invalid = false; - if (count($ex)!=6) { + if (count($ex) != 6) { $invalid = true; } foreach($ex AS $value) { - if (!preg_match("/[0-9a-fA-F][0-9a-fA-F]/", $value) || strlen($value)!="2") { + if (!preg_match("/[0-9a-fA-F][0-9a-fA-F]/", $value) || strlen($value) != "2") { $invalid = true; } } @@ -308,9 +308,9 @@ class fixed_ip extends baseModule { } // MAC address - $_POST['mac_'.$id] = strtolower(trim($_POST['mac_'.$id])); + $_POST['mac_' . $id] = strtolower(trim($_POST['mac_' . $id])); - $invalid = $this->check_mac($_POST['mac_'.$id]); + $invalid = $this->check_mac($_POST['mac_' . $id]); if ($invalid) { $error = true; }