1
0
Fork 0
mirror of https://codeberg.org/demostf/api.git synced 2026-06-03 18:04:08 +02:00

type hint

This commit is contained in:
Robin Appelman 2020-11-28 19:42:53 +01:00
commit 0e9cfe7292

View file

@ -7,6 +7,7 @@ namespace Demostf\API;
use Demostf\API\Error\InvalidHashException; use Demostf\API\Error\InvalidHashException;
use Demostf\API\Error\InvalidKeyException; use Demostf\API\Error\InvalidKeyException;
use Flight; use Flight;
use flight\net\Response;
/** @var Container $container */ /** @var Container $container */
$container = require __DIR__ . '/init.php'; $container = require __DIR__ . '/init.php';
@ -75,7 +76,9 @@ Flight::map('error', function (\Exception $ex) {
} elseif ($ex instanceof InvalidHashException) { } elseif ($ex instanceof InvalidHashException) {
$code = 412; $code = 412;
} }
Flight::response()->status($code)->write($ex->getMessage())->send(); /** @var Response $response */
$response = Flight::response()->status($code);
$response->write($ex->getMessage())->send();
}); });
Flight::start(); Flight::start();