Lines 100.00% 10 / 10
Methods 100.00% 2 / 2
Classes 100.00% 1 / 1
Name Lines Methods CRAP
 readResponse 100.00% 7 / 7 100.00% 1 / 1 1
 [BO\Zmsbackend\Api\BaseController] __invoke 100.00% 3 / 3 100.00% 1 / 1 1
15class UseraccountListByRole extends \BO\Zmsbackend\Api\BaseController
16{
17    /**
18     * @SuppressWarnings(Param)
19     * @return \Psr\Http\Message\ResponseInterface
20     */
21    #[\Override]
22    public function readResponse(
23        RequestInterface $request,
24        ResponseInterface $response,
25        array $args
26    ) {
27        $roleName = $args['roleName'];
28        $workstation = (new \BO\Zmsbackend\Helper\User($request, 1))->checkPermissions('useraccount');
29
30        $useraccountList = (new \BO\Zmsbackend\Useraccount\Service\Useraccount())->readListRole($roleName, 0, $workstation);
31
32        $message = \BO\Zmsbackend\Api\Response\Message::create($request);
33        $message->data = $useraccountList;
34
35        $response = Render::withLastModified($response, time(), '0');
36        return Render::withJson($response, $message, 200);
37    }
38}

Inherited from BO\Zmsbackend\Api\BaseController

20    public function __invoke(RequestInterface $request, ResponseInterface $response, array $args)
21    {
22        $request = $this->initRequest($request);
23        $noCacheResponse = \BO\Slim\Render::withLastModified($response, time(), '0');
24        return $this->readResponse($request, $noCacheResponse, $args);
25    }