Skip to content

Commit 38d18eb

Browse files
committed
deprecated FlattenException::create()
1 parent 0444876 commit 38d18eb

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

DataCollector/ExceptionDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function collect(Request $request, Response $response, \Exception $except
2929
{
3030
if (null !== $exception) {
3131
$this->data = [
32-
'exception' => FlattenException::create($exception),
32+
'exception' => FlattenException::createFromThrowable($exception),
3333
];
3434
}
3535
}

EventListener/ExceptionListener.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct($controller, LoggerInterface $logger = null, $debug
4242

4343
public function logKernelException(GetResponseForExceptionEvent $event)
4444
{
45-
$e = FlattenException::create($event->getException());
45+
$e = FlattenException::createFromThrowable($event->getException());
4646

4747
$this->logException($event->getException(), sprintf('Uncaught PHP Exception %s: "%s" at %s line %s', $e->getClass(), $e->getMessage(), $e->getFile(), $e->getLine()));
4848
}
@@ -64,7 +64,7 @@ public function onKernelException(GetResponseForExceptionEvent $event)
6464
try {
6565
$response = $event->getKernel()->handle($request, HttpKernelInterface::SUB_REQUEST, false);
6666
} catch (\Exception $e) {
67-
$f = FlattenException::create($e);
67+
$f = FlattenException::createFromThrowable($e);
6868

6969
$this->logException($e, sprintf('Exception thrown when handling an exception (%s: %s at %s line %s)', $f->getClass(), $f->getMessage(), $e->getFile(), $e->getLine()));
7070

@@ -132,7 +132,7 @@ protected function duplicateRequest(\Exception $exception, Request $request)
132132
{
133133
$attributes = [
134134
'_controller' => $this->controller,
135-
'exception' => FlattenException::create($exception),
135+
'exception' => FlattenException::createFromThrowable($exception),
136136
'logger' => $this->logger instanceof DebugLoggerInterface ? $this->logger : null,
137137
];
138138
$request = $request->duplicate(null, null, $attributes);

Tests/DataCollector/ExceptionDataCollectorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function testCollect()
2323
{
2424
$e = new \Exception('foo', 500);
2525
$c = new ExceptionDataCollector();
26-
$flattened = FlattenException::create($e);
26+
$flattened = FlattenException::createFromThrowable($e);
2727
$trace = $flattened->getTrace();
2828

2929
$this->assertFalse($c->hasException());

0 commit comments

Comments
 (0)