1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-24 01:20:40 +01:00

Merge branch '3.2.x'

This commit is contained in:
Marc Alexander 2017-10-29 12:49:25 +01:00
commit 7a54b0631d
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995
2 changed files with 2 additions and 12 deletions

View File

@ -3,7 +3,6 @@ services:
class: phpbb\console\exception_subscriber
arguments:
- '@language'
- '%debug.exceptions%'
tags:
- { name: kernel.event_subscriber }

View File

@ -29,12 +29,10 @@ class exception_subscriber implements EventSubscriberInterface
* Construct method
*
* @param \phpbb\language\language $language Language object
* @param bool $debug Debug mode
*/
public function __construct(\phpbb\language\language $language, $debug = false)
public function __construct(\phpbb\language\language $language)
{
$this->language = $language;
$this->debug = $debug;
}
/**
@ -52,14 +50,7 @@ class exception_subscriber implements EventSubscriberInterface
$parameters = array_merge(array($original_exception->getMessage()), $original_exception->get_parameters());
$message = call_user_func_array(array($this->language, 'lang'), $parameters);
if ($this->debug)
{
$exception = new \RuntimeException($message , $original_exception->getCode(), $original_exception);
}
else
{
$exception = new \RuntimeException($message , $original_exception->getCode());
}
$exception = new \RuntimeException($message , $original_exception->getCode(), $original_exception);
$event->setException($exception);
}