Skip to content

Commit 7219419

Browse files
committed
Fixed casting CurlMultiHandle to (int)
1 parent 2d98ddd commit 7219419

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/Type/ObjectType.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ public function toInteger(): Type
310310
return new IntegerType();
311311
}
312312

313-
if ($this->getClassName() === 'CurlHandle') {
313+
if (in_array($this->getClassName(), ['CurlHandle', 'CurlMultiHandle'], true)) {
314314
return new IntegerType();
315315
}
316316

tests/PHPStan/Rules/Cast/data/invalid-cast.php

+5
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,8 @@ function (): void {
6262
$ch = curl_init();
6363
(int) $ch;
6464
};
65+
66+
function (): void {
67+
$ch = curl_multi_init();
68+
(int) $ch;
69+
};

0 commit comments

Comments
 (0)