Skip to content

Commit

Permalink
Regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Nov 9, 2021
1 parent 74787be commit b92c18b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/PHPStan/Rules/Methods/CallMethodsRuleTest.php
Expand Up @@ -2218,4 +2218,16 @@ public function testBug5868(): void
]);
}

public function testBug5460(): void
{
if (!self::$useStaticReflectionProvider) {
$this->markTestSkipped('Test requires static reflection.');
}

$this->checkThisOnly = false;
$this->checkNullables = true;
$this->checkUnionTypes = true;
$this->analyse([__DIR__ . '/data/bug-5460.php'], []);
}

}
15 changes: 15 additions & 0 deletions tests/PHPStan/Rules/Methods/data/bug-5460.php
@@ -0,0 +1,15 @@
<?php

namespace Bug5460;

function (): void {
$request = new \http\Client\Request("POST", "", []);
$request->setOptions(["timeout" => 1]);

$request->getBody()->append("");

$client = new \http\Client();
$client->enqueue($request)->send();

$response = $client->getResponse($request);
};

0 comments on commit b92c18b

Please sign in to comment.