21 if (!self::$instance) {
22 self::$instance =
new self;
30 $response = $command->
getRequest()->getResponse();
33 if ($contentType = $command[
'command.expects']) {
34 $response->setHeader(
'Content-Type', $contentType);
36 $contentType = (string) $response->getHeader(
'Content-Type');
39 return $this->
handleParsing($command, $response, $contentType);
45 if ($result->getBody()) {
46 if (stripos($contentType,
'json') !==
false) {
47 $result = $result->json();
48 } elseif (stripos($contentType,
'xml') !==
false) {
49 $result = $result->xml();