@@ -55,7 +55,9 @@ |
||
| 55 | 55 | */ |
| 56 | 56 | private $passwordHash; |
| 57 | 57 | |
| 58 | - private function __construct() {} |
|
| 58 | + private function __construct() |
|
| 59 | + { |
|
| 60 | +} |
|
| 59 | 61 | |
| 60 | 62 | public static function register(string $name, string $email, string $password): Person |
| 61 | 63 | { |
@@ -32,12 +32,14 @@ |
||
| 32 | 32 | |
| 33 | 33 | $response = $next($request, $response); |
| 34 | 34 | |
| 35 | - } catch (BadRequestException $exception) { |
|
| 35 | + } |
|
| 36 | + catch (BadRequestException $exception) { |
|
| 36 | 37 | |
| 37 | 38 | $response = $response->withStatus(Httpstatuscodes::HTTP_BAD_REQUEST); |
| 38 | 39 | $this->writeViolationsToResponse($exception, $response); |
| 39 | 40 | |
| 40 | - } catch (ResourceNotFoundException $exception) { |
|
| 41 | + } |
|
| 42 | + catch (ResourceNotFoundException $exception) { |
|
| 41 | 43 | |
| 42 | 44 | $response = $response->withStatus(Httpstatuscodes::HTTP_NOT_FOUND); |
| 43 | 45 | } |
@@ -48,7 +48,8 @@ |
||
| 48 | 48 | { |
| 49 | 49 | try { |
| 50 | 50 | $command = $this->serializer->deserialize((string)$request->getBody(), $commandClass, parent::JSON_FORMAT); |
| 51 | - } catch (SerializerException $exception) { |
|
| 51 | + } |
|
| 52 | + catch (SerializerException $exception) { |
|
| 52 | 53 | throw new BadRequestException("Invalid request body", Httpstatuscodes::HTTP_BAD_REQUEST, $exception); |
| 53 | 54 | } |
| 54 | 55 | |