Delete::delete()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 3

Importance

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