UserController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 20
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A avatar() 0 3 1
A context() 0 3 1
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