File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 resolveFromConfigFile =" true"
55 xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
66 xmlns =" https://getpsalm.org/schema/config"
7- phpVersion =" 7.4 "
7+ phpVersion =" 8.0 "
88 xsi : schemaLocation =" https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
99 errorBaseline =" psalm-baseline.xml"
1010>
Original file line number Diff line number Diff line change @@ -139,9 +139,9 @@ class API {
139139 /**
140140 * cURL resource
141141 *
142- * @var CurlHandle|resource|false| null
142+ * @var CurlHandle|null
143143 */
144- protected $ resource ;
144+ protected CurlHandle | null $ resource = null ;
145145
146146 /**
147147 * Information about last client request
@@ -247,7 +247,7 @@ public function __destruct() {
247247 * @return bool
248248 */
249249 public function isConnected (): bool {
250- return is_resource ( $ this -> resource ) || $ this ->resource instanceof CurlHandle;
250+ return $ this ->resource instanceof CurlHandle;
251251 }
252252
253253 /**
@@ -346,12 +346,14 @@ protected function setCURLOptions(): self {
346346 * @throws RuntimeException on error
347347 */
348348 public function connect (): self {
349- $ this -> resource = curl_init ();
349+ $ curl = curl_init ();
350350
351- if (!$ this -> resource ) {
351+ if (!$ curl instanceof CurlHandle ) {
352352 throw new RuntimeException ('Unable to initiate cURL session ' );
353353 }
354354
355+ $ this ->resource = $ curl ;
356+
355357 return $ this ;
356358 }
357359
You can’t perform that action at this time.
0 commit comments