Delete   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

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