File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,6 @@ public static function execute(Google_Client $client, Google_Http_Request $req)
4444 return self ::decodeHttpResponse ($ httpRequest );
4545 }
4646
47-
4847 /**
4948 * Decode an HTTP Response.
5049 * @static
@@ -57,7 +56,7 @@ public static function decodeHttpResponse($response)
5756 $ code = $ response ->getResponseHttpCode ();
5857 $ body = $ response ->getResponseBody ();
5958 $ decoded = null ;
60-
59+
6160 if ((intVal ($ code )) >= 300 ) {
6261 $ decoded = json_decode ($ body , true );
6362 $ err = 'Error calling ' . $ response ->getRequestMethod () . ' ' . $ response ->getUrl ();
@@ -79,16 +78,14 @@ public static function decodeHttpResponse($response)
7978
8079 throw new Google_Service_Exception ($ err , $ code , null , $ errors );
8180 }
82-
81+
8382 // Only attempt to decode the response, if the response code wasn't (204) 'no content'
8483 if ($ code != '204 ' ) {
8584 $ decoded = json_decode ($ body , true );
8685 if ($ decoded === null || $ decoded === "" ) {
8786 throw new Google_Service_Exception ("Invalid json in service response: $ body " );
8887 }
8988
90- $ decoded = isset ($ decoded ['data ' ]) ? $ decoded ['data ' ] : $ decoded ;
91-
9289 if ($ response ->getExpectedClass ()) {
9390 $ class = $ response ->getExpectedClass ();
9491 $ decoded = new $ class ($ decoded );
You can’t perform that action at this time.
0 commit comments