Passed
Push — master ( b8091d...543f5f )
by Brendan
55s queued 11s
created

TelnetResponse::getPromptMatches()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

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
nc 1
nop 0
crap 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