Skip to content

Commit

Permalink
Fixed casting CurlMultiHandle to (int)
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Oct 16, 2020
1 parent 2d98ddd commit 7219419
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Type/ObjectType.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public function toInteger(): Type
return new IntegerType();
}

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

Expand Down
5 changes: 5 additions & 0 deletions tests/PHPStan/Rules/Cast/data/invalid-cast.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,8 @@ function (): void {
$ch = curl_init();
(int) $ch;
};

function (): void {
$ch = curl_multi_init();
(int) $ch;
};

0 comments on commit 7219419

Please sign in to comment.