Completed
Push — master ( b0e9fb...0c2496 )
by Tarmo
35s queued 13s
created

UserController::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 1
dl 0
loc 3
ccs 1
cts 1
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types = 1);
3
/**
4
 * /src/Controller/v1/User/UserController.php
5
 *
6
 * @author TLe, Tarmo Leppänen <[email protected]>
7
 */
8
9
namespace App\Controller\v1\User;
10
11
use App\DTO\User\UserCreate;
12
use App\DTO\User\UserPatch;
13
use App\DTO\User\UserUpdate;
14
use App\Resource\UserResource;
15
use App\Rest\Controller;
16
use App\Rest\Traits\Actions;
17
use OpenApi\Annotations as OA;
18
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
19
use Symfony\Component\Routing\Annotation\Route;
20
use Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter;
21
22
/**
23
 * Class UserController
24
 *
25
 * @OA\Tag(name="User Management")
26
 *
27
 * @package App\Controller\v1\User
28
 * @author TLe, Tarmo Leppänen <[email protected]>
29
 *
30
 * @method UserResource getResource()
31
 */
32
#[Route(
33
    path: '/v1/user',
34
)]
35
#[IsGranted(AuthenticatedVoter::IS_AUTHENTICATED_FULLY)]
36
class UserController extends Controller
37
{
38
    use Actions\Admin\CountAction;
39
    use Actions\Admin\FindAction;
40
    use Actions\Admin\FindOneAction;
41
    use Actions\Admin\IdsAction;
42
    use Actions\Root\CreateAction;
43
    use Actions\Root\PatchAction;
44
    use Actions\Root\UpdateAction;
45
46
    /**
47
     * @var array<string, string>
48
     */
49
    protected static array $dtoClasses = [
50
        Controller::METHOD_CREATE => UserCreate::class,
51
        Controller::METHOD_UPDATE => UserUpdate::class,
52
        Controller::METHOD_PATCH => UserPatch::class,
53
    ];
54
55 76
    public function __construct(
56
        protected UserResource $resource,
57
    ) {
58 76
    }
59
}
60