Delete::delete()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 7
c 1
b 0
f 0
nc 4
nop 1
dl 0
loc 10
ccs 8
cts 8
cp 1
crap 3
rs 10
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