8000 Use do-while · symfony/symfony@015da50 · GitHub
[go: up one dir, main page]

Skip to content

Commit 015da50

Browse files
authored
Use do-while
1 parent c47cd70 commit 015da50

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,12 @@ public function onKernelException(GetResponseForExceptionEvent $event)
5656
} catch (\Exception $e) {
5757
$this->logException($e, sprintf('Exception thrown when handling an exception (%s: %s at %s line %s)', \get_class($e), $e->getMessage(), $e->getFile(), $e->getLine()));
5858

59-
if ($exception === $e) {
60-
throw $e;
61-
}
62-
63-
$wrapper = $e;
64-
65-
while ($prev = $wrapper->getPrevious()) {
59+
$prev = $e;
60+
do {
6661
if ($exception === $wrapper = $prev) {
6762
throw $e;
6863
}
69-
}
64+
} while ($prev = $wrapper->getPrevious());
7065

7166
$prev = new \ReflectionProperty($wrapper instanceof \Exception ? \Exception::class : \Error::class, 'previous');
7267
$prev->setAccessible(true);

0 commit comments

Comments
 (0)
0