Completed
Push — develop ( b68cde...86f0dd )
by Adam
57s queued 52s
created

AbstractResponse   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 48
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getRequest() 0 4 1
A getData() 0 4 1
1
<?php
2
/**
3
 * Abstract Response
4
 */
5
6
namespace IBM\Watson\Common\Message;
7
8
/**
9
 * Abstract Response
10
 *
11
 * This abstract class implements ResponseInterface and defines a basic
12
 * set of functions that all Watson Response are intended to include
13
 *
14
 * @see ResponseInterface
15
 */
16
abstract class AbstractResponse implements ResponseInterface
17
{
18
    /**
19
     * The embodied request object
20
     *
21
     * @var RequestInterface
22
     */
23
    protected $request;
24
25
    /**
26
     * The data contained in the response
27
     *
28
     * @var mixed
29
     */
30
    protected $data;
31
32
    /**
33
     * Create a response
34
     *
35
     * @param RequestInterface $request The initiating request
36
     * @param mixed $data
37
     */
38 3
    public function __construct(RequestInterface $request, $data)
39
    {
40 3
        $this->request = $request;
41 3
        $this->data = $data;
42 3
    }
43
44
    /**
45
     * Get the initiating request
46
     *
47
     * @return RequestInterface
48
     */
49 3
    public function getRequest()
50
    {
51 3
        return $this->request;
52
    }
53
54
    /**
55
     * Get the response data
56
     *
57
     * @return mixed
58
     */
59 3
    public function getData()
60
    {
61 3
        return $this->data;
62
    }
63
}
64