-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathExceptionHandlerPreferences.php
More file actions
46 lines (39 loc) · 1.3 KB
/
ExceptionHandlerPreferences.php
File metadata and controls
46 lines (39 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
namespace Equip\Handler;
use Equip\Env;
use Equip\Structure\Dictionary;
use Whoops\Handler\JsonResponseHandler;
use Whoops\Handler\PlainTextHandler;
use Whoops\Handler\PrettyPageHandler;
use Whoops\Handler\XmlResponseHandler;
class ExceptionHandlerPreferences extends Dictionary
{
/**
* @var UserRepository
*/
private $debug;
/**
* @inheritDoc
*/
public function __construct(array $data = [], Env $env)
{
$data += [
'text/html' => PrettyPageHandler::class,
'application/javascript' => JsonResponseHandler::class,
'application/json' => JsonResponseHandler::class,
'application/ld+json' => JsonResponseHandler::class,
'application/vnd.api+json' => JsonResponseHandler::class,
'application/vnd.geo+json' => JsonResponseHandler::class,
'application/xml' => XmlResponseHandler::class,
'application/atom+xml' => XmlResponseHandler::class,
'application/rss+xml' => XmlResponseHandler::class,
'text/plain' => PlainTextHandler::class,
]; // @codeCoverageIgnore
$this->debug = (bool) $env->getValue('DEBUG_STACKTRACE', false);
parent::__construct($data);
}
public function displayDebug( )
{
return $this->debug;
}
}