@@ 67-69 (lines=3) @@ | ||
64 | * @return \SimpleXMLElement|null |
|
65 | */ |
|
66 | public function getContentXML() { |
|
67 | if(!$this->isError() && strpos($this->headers['Content-Type'], 'text/xml') !== false) { |
|
68 | return new \SimpleXMLElement($this->content); |
|
69 | } |
|
70 | return null; |
|
71 | } |
|
72 | ||
@@ 79-81 (lines=3) @@ | ||
76 | * @return stdclass|null |
|
77 | */ |
|
78 | public function getContentJSON() { |
|
79 | if(!$this->isError() && strpos($this->headers['Content-Type'], 'application/json') !== false) { |
|
80 | return json_decode($this->content); |
|
81 | } |
|
82 | return null; |
|
83 | } |
|
84 | ||
@@ 91-93 (lines=3) @@ | ||
88 | * @return \SimpleXMLElement|stdclass|null |
|
89 | */ |
|
90 | public function getContent() { |
|
91 | if(!$this->isError() && strpos($this->headers['Content-Type'], 'application/json') !== false) { |
|
92 | return $this->getContentJSON(); |
|
93 | } |
|
94 | if(!$this->isError() && strpos($this->headers['Content-Type'], 'text/xml') !== false) { |
|
95 | return $this->getContentXML(); |
|
96 | } |
|
@@ 94-96 (lines=3) @@ | ||
91 | if(!$this->isError() && strpos($this->headers['Content-Type'], 'application/json') !== false) { |
|
92 | return $this->getContentJSON(); |
|
93 | } |
|
94 | if(!$this->isError() && strpos($this->headers['Content-Type'], 'text/xml') !== false) { |
|
95 | return $this->getContentXML(); |
|
96 | } |
|
97 | return $this->content; |
|
98 | } |
|
99 |