Delete   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A delete() 0 10 3
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Service\User;
6
7
final class Delete extends Base
8
{
9 1
    public function delete(int $userId): void
10
    {
11 1
        $this->getUserFromDb($userId);
12 1
        $this->userRepository->deleteUserTasks($userId);
13 1
        $this->userRepository->delete($userId);
14 1
        if (self::isRedisEnabled() === true) {
15 1
            $this->deleteFromCache($userId);
16
        }
17 1
        if (self::isLoggerEnabled() === true) {
18 1
            $this->loggerService->setInfo('The user with the ID ' . $userId . ' has deleted successfully.');
19
        }
20 1
    }
21
}
22