Completed
Push — master ( 25abe9...41762b )
by John
23s
created

Dynamark3Response::getResponseText()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
ccs 1
cts 1
cp 1
crap 1
rs 10
1
<?php
2
3
/**
4
 * This file is part of graze/dynamark3-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/dynamark3-client/blob/master/LICENSE.md
12
 * @link https://github.com/graze/dynamark3-client
13
 */
14
15
namespace Graze\Dynamark3Client;
16
17
use Graze\Dynamark3Client\Dynamark3ResponseInterface;
18
19
class Dynamark3Response implements Dynamark3ResponseInterface
20
{
21
    /**
22
     * @var string
23
     */
24
    protected $responseText;
25
26
    /**
27
     * @var int
28
     */
29
    protected $errorCode;
30
31
    /**
32
     * @param string $responseText
33 6
     * @param int $errorCode
34
     */
35 6
    public function __construct($responseText, $errorCode = null)
36 6
    {
37 6
        $this->setResponseText($responseText);
38
        $this->setErrorCode($errorCode);
39
    }
40
41
    /**
42 6
     * @param string $responseText
43
     */
44 6
    public function setResponseText($responseText)
45 6
    {
46
        $this->responseText = $responseText;
47
    }
48
49
    /**
50 6
     * @param int $errorCode
51
     */
52 6
    public function setErrorCode($errorCode)
53 6
    {
54
        $this->errorCode = (int) $errorCode;
55
    }
56
57
    /**
58 4
     * @return string
59
     */
60 4
    public function getResponseText()
61
    {
62
        return $this->responseText;
63
    }
64
65
    /**
66 6
     * @return bool
67
     */
68 6
    public function isError()
69
    {
70
        return (bool) $this->errorCode;
71
    }
72
73
    /**
74 4
     * @return int
75
     */
76 4
    public function getErrorCode()
77
    {
78
        return $this->errorCode;
79
    }
80
}
81