Esempio n. 1
0
 /**
  * @param Response $response
  *
  * @return SoapResponse|null
  */
 public static function Create(Response $response)
 {
     libxml_use_internal_errors(true);
     $result = simplexml_load_string($response->getBody());
     if (empty($result)) {
         return null;
     }
     return new self($result);
 }
Esempio n. 2
0
 /**
  * @param Response $response
  *
  * @return JsonResponse|null
  */
 public static function Create(Response $response)
 {
     foreach (self::CONTENT_TYPE as $content_type) {
         if (stripos($response->getHeader()->get('Content-Type'), $content_type) !== false) {
             $result = json_decode($response->getBody());
             if (empty($result)) {
                 break;
             }
             return new self($result);
         }
     }
     return null;
 }