1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-21 07:51:33 +02:00

[ticket/10411] Throw exceptions instead of using trigger_error()

PHPBB3-10411
This commit is contained in:
Joas Schilling
2013-02-26 16:52:53 +01:00
parent 41eea66da9
commit e0df593448
3 changed files with 28 additions and 55 deletions

View File

@@ -42,11 +42,6 @@ class phpbb_groupposition_legend implements phpbb_groupposition_interface
*/
protected $user;
/**
* URI for the adm_back_link when there was an error.
*/
protected $adm_back_link = '';
/**
* Constructor
*
@@ -59,16 +54,6 @@ class phpbb_groupposition_legend implements phpbb_groupposition_interface
$this->user = $user;
}
/**
* Set the back link for error messages
*
* @param string $adm_back_link Return URL to use after an error occured
*/
public function set_admin_back_link($adm_back_link)
{
$this->adm_back_link = $adm_back_link;
}
/**
* Returns the group_legend for a given group, if the group exists.
*
@@ -86,7 +71,7 @@ class phpbb_groupposition_legend implements phpbb_groupposition_interface
if ($current_value === false)
{
// Group not found.
$this->error('NO_GROUP');
throw new phpbb_groupposition_exception('NO_GROUP');
}
return (int) $current_value;
@@ -241,16 +226,6 @@ class phpbb_groupposition_legend implements phpbb_groupposition_interface
return false;
}
/**
* Error
*
* {@inheritDoc}
*/
private function error($message)
{
trigger_error($this->user->lang[$message] . (($this->adm_back_link) ? adm_back_link($this->adm_back_link) : ''), E_USER_WARNING);
}
/**
* Get group type language var
*