1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[ticket/13793] Remove translation on throwing exceptions

PHPBB3-13793
This commit is contained in:
MateBartus
2015-04-29 00:13:29 +02:00
parent d67fdfa02b
commit 57072a1e28
14 changed files with 44 additions and 70 deletions

View File

@@ -16,6 +16,6 @@ namespace phpbb\controller;
/**
* Controller exception class
*/
class exception extends \RuntimeException
class exception extends \phpbb\exception\runtime_exception
{
}

View File

@@ -22,12 +22,6 @@ use Symfony\Component\HttpFoundation\Request;
*/
class resolver implements ControllerResolverInterface
{
/**
* User object
* @var \phpbb\user
*/
protected $user;
/**
* ContainerInterface object
* @var ContainerInterface
@@ -55,14 +49,12 @@ class resolver implements ControllerResolverInterface
/**
* Construct method
*
* @param \phpbb\user $user User Object
* @param ContainerInterface $container ContainerInterface object
* @param string $phpbb_root_path Relative path to phpBB root
* @param \phpbb\template\template $template
*/
public function __construct(\phpbb\user $user, ContainerInterface $container, $phpbb_root_path, \phpbb\template\template $template = null)
public function __construct(ContainerInterface $container, $phpbb_root_path, \phpbb\template\template $template = null)
{
$this->user = $user;
$this->container = $container;
$this->template = $template;
$this->type_cast_helper = new \phpbb\request\type_cast_helper();
@@ -82,20 +74,20 @@ class resolver implements ControllerResolverInterface
if (!$controller)
{
throw new \phpbb\controller\exception($this->user->lang['CONTROLLER_NOT_SPECIFIED']);
throw new \phpbb\controller\exception('CONTROLLER_NOT_SPECIFIED');
}
// Require a method name along with the service name
if (stripos($controller, ':') === false)
{
throw new \phpbb\controller\exception($this->user->lang['CONTROLLER_METHOD_NOT_SPECIFIED']);
throw new \phpbb\controller\exception('CONTROLLER_METHOD_NOT_SPECIFIED');
}
list($service, $method) = explode(':', $controller);
if (!$this->container->has($service))
{
throw new \phpbb\controller\exception($this->user->lang('CONTROLLER_SERVICE_UNDEFINED', $service));
throw new \phpbb\controller\exception('CONTROLLER_SERVICE_UNDEFINED', array($service));
}
$controller_object = $this->container->get($service);
@@ -166,7 +158,7 @@ class resolver implements ControllerResolverInterface
}
else
{
throw new \phpbb\controller\exception($this->user->lang('CONTROLLER_ARGUMENT_VALUE_MISSING', $param->getPosition() + 1, get_class($object) . ':' . $method, $param->name));
throw new \phpbb\controller\exception('CONTROLLER_ARGUMENT_VALUE_MISSING', array($param->getPosition() + 1, get_class($object) . ':' . $method, $param->name));
}
}