1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-18 06:21:19 +02:00

[ticket/16955] Clean up group related classes for psalm

PHPBB3-16955
This commit is contained in:
Marc Alexander
2022-12-26 14:41:18 +01:00
parent c4d3e1aa7b
commit d9c179f9ef
3 changed files with 34 additions and 20 deletions

View File

@@ -47,8 +47,9 @@ class legend implements \phpbb\groupposition\groupposition_interface
* Returns the group_legend for a given group, if the group exists.
*
* @param int $group_id group_id of the group to be selected
*
* @return int position of the group
* @throws \phpbb\groupposition\exception
* @throws exception
*/
public function get_group_value($group_id)
{
@@ -62,7 +63,7 @@ class legend implements \phpbb\groupposition\groupposition_interface
if ($current_value === false)
{
// Group not found.
throw new \phpbb\groupposition\exception('NO_GROUP');
throw new exception('NO_GROUP');
}
return (int) $current_value;
@@ -212,11 +213,13 @@ class legend implements \phpbb\groupposition\groupposition_interface
}
/**
* Get group type language var
*
* @param int $group_type group_type from the groups-table
* @return string name of the language variable for the given group-type.
*/
* Get group type language var
*
* @param int $group_type group_type from the groups-table
*
* @return string name of the language variable for the given group-type.
* @throws exception If invalid group type is supplied
*/
public static function group_type_language($group_type)
{
switch ($group_type)
@@ -231,6 +234,8 @@ class legend implements \phpbb\groupposition\groupposition_interface
return 'GROUP_SPECIAL';
case GROUP_FREE:
return 'GROUP_OPEN';
default:
throw new exception('NO_GROUP');
}
}
}