public static function getJSONResponseToArray($string) {
    $json = json_decode($string,true);
    if($json !== NULL) {
      return $json;
    }
    else {
      throw new \Exception('Response is not a valid json string.');
    }
  }
public static function getJSONResponseToArray($string) {
    $json = json_decode($string,true);
    if($json !== NULL) {
      return $json;
    }
    else {
      throw new \Exception('Response is not a valid json string.');
    }
  }
public static function getJSONResponseToArray ( $ string ) { $ json = json_decode ( $ string , true ) ; if ( $ json !== NULL ) { return $ json ; } else { throw new \ Exception ( 'Response is not a valid json string.' ) ; } }
Decodes a json string and returns an array

@param String json string
@return mixed[] array of an parsed json string
@throws \Exception if string is not a valid json string
Decodes a json string and returns an array