mirror of
https://codeberg.org/demostf/api.git
synced 2026-06-03 18:04:08 +02:00
fmt, typings, typos
This commit is contained in:
parent
eb997b5ba2
commit
7de4c35ab4
34 changed files with 644 additions and 1048 deletions
|
|
@ -34,13 +34,8 @@ class BaseController {
|
|||
return $this->request->data[$name] ?? $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $data
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
protected function json(
|
||||
$data,
|
||||
mixed $data,
|
||||
int $code = 200,
|
||||
bool $encode = true,
|
||||
string $charset = 'utf-8',
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@ class DemoController extends BaseController {
|
|||
|
||||
public function get(string $id): void {
|
||||
$demo = $this->demoProvider->get(\intval($id, 10));
|
||||
if ($demo === null) {
|
||||
throw new NotFoundException("requested demo not found");
|
||||
if (null === $demo) {
|
||||
throw new NotFoundException('requested demo not found');
|
||||
} else {
|
||||
$this->json($demo);
|
||||
}
|
||||
|
|
@ -146,7 +146,7 @@ class DemoController extends BaseController {
|
|||
|
||||
$demo = $this->demoProvider->get((int) $id);
|
||||
if (!$demo) {
|
||||
throw new NotFoundException("Demo not found");
|
||||
throw new NotFoundException('Demo not found');
|
||||
}
|
||||
|
||||
$existingHash = $demo->getHash();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue