Completed
Push — master ( e1eba3...584ae4 )
by Marc
02:55
created

AbstractNetworkAdapter::getGraph()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/*
3
 * This file is part of the phpflo/phpflo-flowtrace package.
4
 *
5
 * (c) Marc Aschmann <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace PhpFlo\Common;
12
13
/**
14
 * Class AbstractNetworkAdapter
15
 *
16
 * @package PhpFlo\Common
17
 * @author Marc Aschmann <[email protected]>
18
 */
19
abstract class AbstractNetworkAdapter
20
{
21
    /**
22
     * @var NetworkInterface
23
     */
24
    protected $network;
25
26
    /**
27
     * AbstractNetworkAdapter constructor.
28
     *
29
     * @param NetworkInterface $network
30
     */
31 2
    public function __construct(NetworkInterface $network)
32
    {
33 2
        $this->network = $network;
34 2
    }
35
36
    /**
37
     * @return NetworkInterface
38
     */
39 1
    public function getNetwork()
40
    {
41 1
        return $this->network;
42
    }
43
44
    /**
45
     * @return null|Graph
46
     */
47 1
    public function getGraph()
48
    {
49 1
        return $this->network->getGraph();
50
    }
51
52
    /**
53
     * Cleanup network state after runs.
54
     *
55
     * @return $this
56
     */
57 1
    public function shutdown()
58
    {
59 1
        $this->network->shutdown();
60
61 1
        return $this;
62
    }
63
}
64