Total Complexity | 5 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | class DummyResponseContext extends ResponseContextAbstract |
||
11 | { |
||
12 | /** |
||
13 | * Get raw result data |
||
14 | * |
||
15 | * @param array $options |
||
16 | * |
||
17 | * @return string|null |
||
18 | */ |
||
19 | public function getRaw(array $options = array()): ?string |
||
20 | { |
||
21 | return $this->content; |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * Get result data as array |
||
26 | * |
||
27 | * @param array $options |
||
28 | * |
||
29 | * @return array |
||
30 | */ |
||
31 | public function getArray(array $options = array()): array |
||
32 | { |
||
33 | return (array)$this->content; |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * Get result data as object |
||
38 | * |
||
39 | * @param array $options |
||
40 | * |
||
41 | * @return object |
||
42 | */ |
||
43 | public function getObject(array $options = array()) |
||
44 | { |
||
45 | return (object)$this->content; |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * String representation of response for debug purposes |
||
50 | * |
||
51 | * @return string |
||
52 | */ |
||
53 | public function __toString(): string |
||
54 | { |
||
55 | return print_r($this->content, true); |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * Makes sure that $content is valid for this AbstractResponseContext instance |
||
60 | * |
||
61 | * @param string $content |
||
62 | * |
||
63 | * @return bool |
||
64 | */ |
||
65 | protected function assertIsValid(string $content): bool |
||
68 | } |
||
69 | } |
||
70 |