format backend code
This commit is contained in:
parent
9577367622
commit
67dd376a2f
40 changed files with 146 additions and 71 deletions
|
|
@ -20,7 +20,8 @@ class AuthController
|
|||
private AuthenticateUser $authenticateUser,
|
||||
private CreateSession $createSession,
|
||||
private Logout $logout,
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
public function login(Request $request): JsonResponse
|
||||
{
|
||||
|
|
@ -33,11 +34,13 @@ class AuthController
|
|||
);
|
||||
} catch (BadRequestException $exception) {
|
||||
return new JsonResponse(
|
||||
['error' => $exception->getMessage()], 400
|
||||
['error' => $exception->getMessage()],
|
||||
400
|
||||
);
|
||||
} catch (UnauthorizedException $exception) {
|
||||
return new JsonResponse(
|
||||
['error' => $exception->getMessage()], 401
|
||||
['error' => $exception->getMessage()],
|
||||
401
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -71,7 +74,7 @@ class AuthController
|
|||
}
|
||||
|
||||
/**
|
||||
* @return array{id: int, email: string, firstname: string, lastname: string}
|
||||
* @return array{id: int, email: string}
|
||||
*/
|
||||
private function buildUserPayload(User $user): array
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,7 +8,9 @@ use Illuminate\Http\JsonResponse;
|
|||
|
||||
class SetController
|
||||
{
|
||||
public function __construct(private SetRepository $setRepository) {}
|
||||
public function __construct(private SetRepository $setRepository)
|
||||
{
|
||||
}
|
||||
|
||||
public function index(): JsonResponse
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue