We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7375680 commit c637d00Copy full SHA for c637d00
src/Request/Message/Body/JsonBody.php
@@ -22,8 +22,12 @@ public function __construct(array $bodyData)
22
$this->bodyData = $bodyData;
23
}
24
25
- public function configureCurl(\CurlHandle $curl): self
+ public function configureCurl(\CurlHandle|false $curl): self
26
{
27
+ if ($curl === false) {
28
+ throw new \TypeError('cURL is not a valid CurlHandle class.');
29
+ }
30
+
31
$jsonBody = json_encode($this->bodyData);
32
if ($jsonBody === false) {
33
throw new HttpRequestMessageException('JSON body data not serializable.');
0 commit comments