GetContextByUser   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 12
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
4
namespace App\Src\UseCases\Domain\Context\Queries;
5
6
7
use App\Src\UseCases\Domain\Context\Dto\ContextDto;
8
use App\Src\UseCases\Domain\Ports\ContextRepository;
9
10
class GetContextByUser
11
{
12
    private $contextRepository;
13
14
    public function __construct(ContextRepository $contextRepository)
15
    {
16
        $this->contextRepository = $contextRepository;
17
    }
18
19
    public function execute(string $userId):?ContextDto
20
    {
21
        return $this->contextRepository->getByUserDto($userId);
22
    }
23
}
24