We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6932cdf commit ff5bea0Copy full SHA for ff5bea0
1 file changed
src/Formatter/GenericErrorFormatter.php
@@ -9,23 +9,33 @@
9
10
final class GenericErrorFormatter extends AbstractErrorFormatter
11
{
12
+ private array $format = [
13
+ 'message' => '{title}',
14
+ 'status' => '{status_code}',
15
+ 'code' => '{code}',
16
+ ];
17
+
18
protected function createProblem(\Throwable $exception): Problem
19
20
return GenericProblem::createFromThrowable($exception);
21
}
22
23
protected function getFormat(): array
24
- $format = [
- 'message' => '{title}',
- 'status' => '{status_code}',
- 'code' => '{code}',
- ];
25
+ $format = $this->format;
26
27
if ($this->debug) {
28
$format['debug'] = '{debug}';
29
30
31
return $format;
32
33
34
+ /**
35
+ * @param array<string, mixed> $format
36
+ */
37
+ public function setFormat(array $format): void
38
+ {
39
+ $this->format = $format;
40
+ }
41
0 commit comments