LocalStorageBuilder   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 38
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 2

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setPathToTheApacheStatusFileToParseUpfront() 0 4 1
A buildFetcher() 0 13 1
1
<?php
2
/**
3
 * @author stev leibelt <[email protected]>
4
 * @since 2017-04-10
5
 */
6
7
namespace Net\Bazzline\Component\ApacheServerStatusParser\Service\Builder;
8
9
use Net\Bazzline\Component\ApacheServerStatusParser\Service\Content\Fetcher\FetcherInterface;
10
use Net\Bazzline\Component\ApacheServerStatusParser\Service\Content\Fetcher\FileFetcher;
11
12
class LocalStorageBuilder extends AbstractStorageBuilder
13
{
14
    /** @var FileFetcher */
15
    private $fetcher;
16
17
    /** @var string */
18
    private $filePath;
19
20
    public function __construct()
21
    {
22
        $this->fetcher = new FileFetcher();
23
    }
24
25
    /**
26
     * @param string $filePath
27
     */
28
    public function setPathToTheApacheStatusFileToParseUpfront($filePath)
29
    {
30
        $this->filePath = $filePath;
31
    }
32
33
    /**
34
     * @return FetcherInterface
35
     */
36
    protected function buildFetcher()
37
    {
38
        //begin of dependencies
39
        $fetcher    = $this->fetcher;
40
        $filePath   = $this->filePath;
41
        //end of dependencies
42
43
        //begin of business logic
44
        $fetcher->setPath($filePath);
45
46
        return $fetcher;
47
        //end of business logic
48
    }
49
}
50