AbstractResponse::getData()   A
last analyzed

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 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * Abstract Response
4
 */
5
6
namespace Bobbyshaw\WatsonVisualRecognition\Message;
7
8
/**
9
 * Abstract Response
10
 *
11
 * This abstract class implements ResponseInterface and defines a basic
12
 * set of functions that all Watson Requests are intended to include.
13
 *
14
 * Objects of this class or a subclass are usually created in the Request
15
 * object (subclass of AbstractRequest) as the return parameters from the
16
 * send() function.
17
 *
18
 */
19
abstract class AbstractResponse implements ResponseInterface
20
{
21
22
    /**
23
     * The embodied request object.
24
     *
25
     * @var RequestInterface
26
     */
27
    protected $request;
28
29
    /**
30
     * The data contained in the response.
31
     *
32
     * @var mixed
33
     */
34
    protected $data;
35
36
    /**
37
     * Constructor
38
     *
39
     * @param RequestInterface $request the initiating request.
40
     * @param mixed $data
41
     */
42 25
    public function __construct(RequestInterface $request, $data)
43
    {
44 25
        $this->request = $request;
45 25
        $this->data = $data;
46 25
    }
47
48
    /**
49
     * Get the initiating request object.
50
     *
51
     * @return RequestInterface
52
     */
53 1
    public function getRequest()
54
    {
55 1
        return $this->request;
56
    }
57
58
59
    /**
60
     * Get the response data.
61
     *
62
     * @return mixed
63
     */
64 1
    public function getData()
65
    {
66 1
        return $this->data;
67
    }
68
}
69