mirror of
https://codeberg.org/demostf/api.git
synced 2026-06-03 18:04:08 +02:00
type hint
This commit is contained in:
parent
8c80182ab1
commit
0e9cfe7292
1 changed files with 4 additions and 1 deletions
|
|
@ -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();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue