1 | <?php |
||
15 | abstract class AbstractResponse implements ResponseInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var RequestInterface |
||
19 | */ |
||
20 | protected $request; |
||
21 | |||
22 | /** |
||
23 | * @var string response data. The property contains RAW response data |
||
24 | * @see decodeData() |
||
25 | * @see isDecoded |
||
26 | */ |
||
27 | protected $data; |
||
28 | |||
29 | /** |
||
30 | * @var bool whether response is already decoded |
||
31 | */ |
||
32 | protected $isDecoded = false; |
||
33 | |||
34 | public function getRequest() |
||
38 | |||
39 | 2 | public function getData() |
|
48 | |||
49 | 2 | public function decodeData() |
|
67 | |||
68 | /** |
||
69 | * Method returns RAW request data. |
||
70 | * |
||
71 | * @return string |
||
72 | */ |
||
73 | abstract public function getRawData(); |
||
74 | |||
75 | /** |
||
76 | * Whether the request is RAW and should not be decoded. |
||
77 | * @return bool |
||
78 | */ |
||
79 | 2 | public function isRaw() |
|
83 | |||
84 | /** |
||
85 | * Method checks whether response is a JSON response. |
||
86 | * @return bool |
||
87 | */ |
||
88 | 2 | public function isJson() |
|
97 | |||
98 | /** |
||
99 | * @param $name |
||
100 | * @return array |
||
101 | */ |
||
102 | abstract public function getHeader($name); |
||
103 | } |
||
104 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.