TelnetResponse   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 53
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A isError() 0 4 1
A getResponseText() 0 4 1
A getPromptMatches() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of graze/telnet-client.
5
 *
6
 * Copyright (c) 2016 Nature Delivered Ltd. <https://www.graze.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * @license https://github.com/graze/telnet-client/blob/master/LICENSE
12
 * @link https://github.com/graze/telnet-client
13
 */
14
15
namespace Graze\TelnetClient;
16
17
class TelnetResponse implements TelnetResponseInterface
18
{
19
    /**
20
     * @var bool
21
     */
22
    protected $isError;
23
24
    /**
25
     * @var string
26
     */
27
    protected $responseText;
28
29
    /**
30
     * @var array
31
     */
32
    protected $promptMatches;
33
34
    /**
35
     * @param bool $isError
36
     * @param string $responseText
37
     * @param array $promptMatches
38
     */
39 15
    public function __construct($isError, $responseText, array $promptMatches)
40
    {
41 15
        $this->isError = (bool) $isError;
42 15
        $this->responseText = $responseText;
43 15
        $this->promptMatches = $promptMatches;
44 15
    }
45
46
    /**
47
     * @return bool
48
     */
49 15
    public function isError()
50
    {
51 15
        return $this->isError;
52
    }
53
54
    /**
55
     * @return string
56
     */
57 15
    public function getResponseText()
58
    {
59 15
        return $this->responseText;
60
    }
61
62
    /**
63
     * @return array
64
     */
65 15
    public function getPromptMatches()
66
    {
67 15
        return $this->promptMatches;
68
    }
69
}
70