UserController::context()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace App\Http\Controllers\Api;
5
6
use App\Src\UseCases\Domain\Context\Queries\GetContextByUser;
7
use App\Src\UseCases\Domain\Users\GetAvatar;
8
use Illuminate\Routing\Controller as BaseController;
9
10
/**
11
 * @group User management
12
 *
13
 * APIs for managing users
14
 */
15
class UserController extends BaseController
16
{
17
18
    /**
19
     * Serve the avatar of the user
20
     * @urlParam id string required The user uuid Example:379189d0-287f-4042-bf81-577deb7696f4
21
     * @urlParam dim integer required Width of the picture in pixels Example:300
22
     */
23
    public function avatar(string $uuid, int $width, GetAvatar $getAvatar)
24
    {
25
        return $getAvatar->execute($uuid, $width);
26
    }
27
28
    /**
29
     * Get the context of a user
30
     * @urlParam id string required the user uuid Example:379189d0-287f-4042-bf81-577deb7696f4
31
     */
32
    public function context(string $uuid, GetContextByUser $contextQueryByUser)
33
    {
34
        return $contextQueryByUser->execute($uuid);
35
    }
36
}
37