Return types
This commit is contained in:
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user