Specify parameter and return types of all other helper class methods

This commit is contained in:
Kijin Sung 2023-09-27 23:39:47 +09:00
parent bde78570f6
commit f4c09bf634
2 changed files with 8 additions and 8 deletions

View file

@ -21,7 +21,7 @@ class ConfigHelper
* @param array $format * @param array $format
* @return array * @return array
*/ */
public static function consolidate($format) public static function consolidate(array $format): array
{ {
self::$_config_cache = array(); self::$_config_cache = array();
$result = array(); $result = array();

View file

@ -46,7 +46,7 @@ class SessionHelper
* *
* @return bool * @return bool
*/ */
public function isMember() public function isMember(): bool
{ {
return $this->member_srl > 0; return $this->member_srl > 0;
} }
@ -56,7 +56,7 @@ class SessionHelper
* *
* @return bool * @return bool
*/ */
public function isAdmin() public function isAdmin(): bool
{ {
return $this->is_admin === 'Y'; return $this->is_admin === 'Y';
} }
@ -64,12 +64,12 @@ class SessionHelper
/** /**
* Check if this user is an administrator of a module. * Check if this user is an administrator of a module.
* *
* @param int $module_srl (optional) * @param ?int $module_srl (optional)
* @return bool * @return bool
*/ */
public function isModuleAdmin($module_srl = null) public function isModuleAdmin(?int $module_srl = null): bool
{ {
return $this->is_admin === 'Y' || \ModuleModel::isModuleAdmin($this, $module_srl); return $this->is_admin === 'Y' || ($module_srl && \ModuleModel::isModuleAdmin($this, $module_srl));
} }
/** /**
@ -77,7 +77,7 @@ class SessionHelper
* *
* @return bool * @return bool
*/ */
public function isValid() public function isValid(): bool
{ {
if ($this->denied === 'N' && (!$this->limit_date || substr($this->limit_date, 0, 8) < date('Ymd'))) if ($this->denied === 'N' && (!$this->limit_date || substr($this->limit_date, 0, 8) < date('Ymd')))
{ {
@ -94,7 +94,7 @@ class SessionHelper
* *
* @return array * @return array
*/ */
public function getGroups() public function getGroups(): array
{ {
return $this->group_list; return $this->group_list;
} }