Improve docs example code

This commit is contained in:
Toby Zerner 2021-08-29 15:50:58 +10:00
parent 589fa47f68
commit 81e0dc63b7
1 changed files with 1 additions and 3 deletions

View File

@ -72,9 +72,7 @@ $api->extension(new Atomic());
/** @var Psr\Http\Message\ServerRequestInterface $request */
/** @var Psr\Http\Message\ResponseInterface $response */
try {
return DB::transaction(function () use ($api, $request) {
return $api->handle($request);
});
return DB::transaction(fn() => $api->handle($request));
} catch (Exception $e) {
$response = $api->error($e);
}