1 | <?php |
||
12 | class CertainResponse |
||
13 | { |
||
14 | |||
15 | /** |
||
16 | * |
||
17 | * @var ResponseInterface|null |
||
18 | */ |
||
19 | private $response; |
||
20 | |||
21 | /** |
||
22 | * |
||
23 | * @param ResponseInterface|null $response |
||
24 | */ |
||
25 | public function __construct($response) |
||
29 | |||
30 | /** |
||
31 | * Decode a string to json. If a jsonp we convert ton json string before deconding. |
||
32 | * @param string $jsonp |
||
33 | * @param boolean $assoc |
||
34 | * @return \stdClass|array |
||
35 | */ |
||
36 | public function jsonp_decode($jsonp, $assoc = false) |
||
44 | |||
45 | /** |
||
46 | * Response about results |
||
47 | * @param string $contentType |
||
48 | * @param boolean $assoc |
||
49 | * @return array |
||
50 | */ |
||
51 | public function getResponse($contentType='json',$assoc = false) |
||
73 | } |