Files
weather/src/Application/Actions/User/ViewUserAction.php
Oh c87bf18b4e
Some checks failed
Tests / Tests PHP 7.4 (push) Has been cancelled
Tests / Tests PHP 8 (push) Has been cancelled
Tests / Tests PHP 8.1 (push) Has been cancelled
Initial commit
2025-09-04 08:59:22 +02:00

24 lines
488 B
PHP

<?php
declare(strict_types=1);
namespace App\Application\Actions\User;
use Psr\Http\Message\ResponseInterface as Response;
class ViewUserAction extends UserAction
{
/**
* {@inheritdoc}
*/
protected function action(): Response
{
$userId = (int) $this->resolveArg('id');
$user = $this->userRepository->findUserOfId($userId);
$this->logger->info("User of id `${userId}` was viewed.");
return $this->respondWithData($user);
}
}