Passed
Push — main ( 2bf89b...450136 )
by mikhail
03:21
created

BaselineManager   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A filterComments() 0 3 1
A setComments() 0 3 1
A init() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SavinMikhail\CommentsDensity\Baseline;
6
7
use SavinMikhail\CommentsDensity\Baseline\Storage\BaselineStorageInterface;
8
9
final class BaselineManager
10
{
11
    private BaselineStorageInterface $storage;
12
13
    public function __construct(BaselineStorageInterface $storage)
14
    {
15
        $this->storage = $storage;
16
    }
17
18
    public function init(string $path): self
19
    {
20
        $this->storage->init($path);
21
        return $this;
22
    }
23
24
    public function setComments(array $comments): void
25
    {
26
        $this->storage->setComments($comments);
27
    }
28
29
    public function filterComments(array $comments): array
30
    {
31
        return $this->storage->filterComments($comments);
32
    }
33
}
34