Customer
2 months ago
Provider
4 months ago
DeleteUserController.php
1 year ago
GetCurrentUserController.php
1 year ago
GetUserDeleteEffectController.php
1 year ago
GetWPUsersController.php
7 years ago
LoginCabinetController.php
10 months ago
LogoutCabinetController.php
4 years ago
GetCurrentUserController.php
36 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AmeliaBooking\Application\Controller\User; |
| 4 | |
| 5 | use AmeliaBooking\Application\Commands\User\GetCurrentUserCommand; |
| 6 | use AmeliaBooking\Application\Controller\Controller; |
| 7 | use Slim\Http\Request; |
| 8 | |
| 9 | /** |
| 10 | * Class GetCurrentUserController |
| 11 | * |
| 12 | * @package AmeliaBooking\Application\Controller\User |
| 13 | */ |
| 14 | class GetCurrentUserController extends Controller |
| 15 | { |
| 16 | /** |
| 17 | * Instantiates the Get Current User command to hand it over to the Command Handler |
| 18 | * |
| 19 | * @param Request $request |
| 20 | * @param $args |
| 21 | * |
| 22 | * @return GetCurrentUserCommand |
| 23 | * @throws \RuntimeException |
| 24 | */ |
| 25 | protected function instantiateCommand(Request $request, $args) |
| 26 | { |
| 27 | $command = new GetCurrentUserCommand($args); |
| 28 | $requestBody = $request->getParsedBody(); |
| 29 | $this->setCommandFields($command, $requestBody); |
| 30 | |
| 31 | $command->setToken($request); |
| 32 | |
| 33 | return $command; |
| 34 | } |
| 35 | } |
| 36 |