<?php
declare(strict_types=1);

final class UserController
{
    public function show(array $req, array $res, array $params): void
    {
        $id = (int)$params['id'];
        $res['json'](['id' => $id, 'name' => 'Ada Lovelace']);
    }

    public function create(array $req, array $res): void
    {
        $data = $req['body'];
        $res['json'](['created' => true, 'data' => $data], 201);
    }

    public function destroy(array $req, array $res, array $params): void
    {
        $id = (int)$params['id'];
        $res['json'](['deleted' => $id]);
    }
}
