setUrlToTheApacheStatusFileToParseUpfront()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * @author stev leibelt <[email protected]>
4
 * @since 2017-04-11
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\HttpFetcher;
11
use Net\Bazzline\Component\Curl\Builder\BuilderFactory;
12
13
class RemoteStorageBuilder extends AbstractStorageBuilder
14
{
15
    /** @var HttpFetcher */
16
    private $fetcher;
17
18
    /** @var string */
19
    private $url;
20
21
    public function __construct()
22
    {
23
        $factory = new BuilderFactory();
24
25
        $this->fetcher = new HttpFetcher(
26
            $factory->create()
27
        );
28
    }
29
30
    /**
31
     * @param string $url
32
     */
33
    public function setUrlToTheApacheStatusFileToParseUpfront($url)
34
    {
35
        $this->url = $url;
36
    }
37
38
    /**
39
     * @return FetcherInterface
40
     */
41
    protected function buildFetcher()
42
    {
43
        //begin of dependencies
44
        $fetcher    = $this->fetcher;
45
        $url        = $this->url;
46
        //end of dependencies
47
48
        //begin of business logic
49
        $fetcher->setUrl($url);
50
51
        return $fetcher;
52
        //end of business logic
53
    }
54
}
55