TcpTunnel::getHost()   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 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of the slince/spike package.
5
 *
6
 * (c) Slince <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Spike\Common\Tunnel;
13
14
class TcpTunnel extends Tunnel
15
{
16
    /**
17
     * @var string
18
     */
19
    protected $host;
20
21
    public function __construct($serverPort, $host)
22
    {
23
        $this->host = $host;
24
        parent::__construct($serverPort);
25
    }
26
27
    /**
28
     * Gets the local host.
29
     *
30
     * @return string
31
     */
32
    public function getHost()
33
    {
34
        return $this->host;
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function toArray()
41
    {
42
        return [
43
            'protocol' => $this->getProtocol(),
44
            'host' => $this->host,
45
            'serverPort' => $this->serverPort,
46
        ];
47
    }
48
49
    /**
50
     * {@inheritdoc}
51
     */
52
    public function getProtocol()
53
    {
54
        return 'tcp';
55
    }
56
}