Skip to content

Commit 8ec5b5f

Browse files
authored
fix: MediaFileUpload fatal error (#2274)
1 parent 94e1964 commit 8ec5b5f

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

src/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ public function prepareScopes()
876876
*
877877
* @template T
878878
* @param RequestInterface $request
879-
* @param class-string<T> $expectedClass
879+
* @param class-string<T>|false|null $expectedClass
880880
* @throws \Google\Exception
881881
* @return mixed|T|ResponseInterface
882882
*/

src/Http/MediaFileUpload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ private function fetchResumeUri()
306306
$this->request = $this->request->withHeader($key, $value);
307307
}
308308

309-
$response = $this->client->execute($this->request, null);
309+
$response = $this->client->execute($this->request, false);
310310
$location = $response->getHeaderLine('location');
311311
$code = $response->getStatusCode();
312312

src/Http/REST.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ class REST
3535
* Executes a Psr\Http\Message\RequestInterface and (if applicable) automatically retries
3636
* when errors occur.
3737
*
38+
* @template T
3839
* @param ClientInterface $client
3940
* @param RequestInterface $request
40-
* @param string $expectedClass
41+
* @param class-string<T>|false|null $expectedClass
4142
* @param array $config
4243
* @param array $retryMap
43-
* @return mixed decoded result
44+
* @return mixed|T|null
4445
* @throws \Google\Service\Exception on server side error (ie: not authenticated,
4546
* invalid or malformed post body, invalid url)
4647
*/
@@ -68,10 +69,11 @@ public static function execute(
6869
/**
6970
* Executes a Psr\Http\Message\RequestInterface
7071
*
72+
* @template T
7173
* @param ClientInterface $client
7274
* @param RequestInterface $request
73-
* @param string $expectedClass
74-
* @return array decoded result
75+
* @param class-string<T>|false|null $expectedClass
76+
* @return mixed|T|null
7577
* @throws \Google\Service\Exception on server side error (ie: not authenticated,
7678
* invalid or malformed post body, invalid url)
7779
*/
@@ -108,11 +110,13 @@ interface_exists('\GuzzleHttp\Message\ResponseInterface')
108110
/**
109111
* Decode an HTTP Response.
110112
* @static
111-
* @throws \Google\Service\Exception
113+
*
114+
* @template T
112115
* @param RequestInterface $response The http response to be decoded.
113116
* @param ResponseInterface $response
114-
* @param string $expectedClass
115-
* @return mixed|null
117+
* @param class-string<T>|false|null $expectedClass
118+
* @return mixed|T|null
119+
* @throws \Google\Service\Exception
116120
*/
117121
public static function decodeHttpResponse(
118122
ResponseInterface $response,

0 commit comments

Comments
 (0)