Return types

This commit is contained in:
2024-07-22 02:36:28 +02:00
parent af588ab174
commit 2168e37413
12 changed files with 35 additions and 46 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ use Khofmann\Models\User\User;
class Register extends Api
{
public function post()
public function post(): void
{
$username = Input::post("username");
if (empty($username)) throw new Exception("Missing username", 400);
@@ -20,7 +20,7 @@ class Register extends Api
if (empty($password)) throw new Exception("Missing password", 400);
try {
return Response::json(User::create($username, $email, $password));
Response::json(User::create($username, $email, $password));
} catch (Exception $err) {
switch ($err->getMessage()) {
case "Duplicate":