Passed
Push — main ( ad42a0...8a363b )
by Daniel
05:42
created

UserDeleter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A delete() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Uxmp\Core\Component\User;
6
7
use Uxmp\Core\Orm\Model\UserInterface;
8
use Uxmp\Core\Orm\Repository\UserRepositoryInterface;
9
10
/**
11
 * Deletes a user including all dependencies and meta data
12
 */
13
final class UserDeleter implements UserDeleterInterface
14
{
15 1
    public function __construct(
16
        private readonly UserRepositoryInterface $userRepository,
17
    ) {
18
    }
19
20 1
    public function delete(UserInterface $user): void
21
    {
22 1
        $this->userRepository->delete($user);
23
    }
24
}
25