Open
Description
I'm using Codeception's wrapper of PHPUnit's assertInternalType
, and thought phpstan would understand the type.
Example code:
$feedHandle = fopen('php://temp', 'rw+');
$this->assertInternalType('resource', $feedHandle);
fwrite($feedHandle, $feed);
Actual result:
Parameter #1 $fp of function fwrite expects resource, resource|false given.
Expected result:
-- Nothing --
Metadata
Metadata
Assignees
Labels
No labels
Activity
ondrejmirtes commentedon Dec 25, 2018
josephzidell commentedon Dec 25, 2018
One of:
\Codeception\Test\Unit
that directly extends\PHPUnit\Framework\TestCase
(unit tests)AcceptanceTester
that uses a trait_generated\AcceptanceTesterActions
which wraps the Codeception assert (acceptance tests)josephzidell commentedon Dec 25, 2018
In the second case, there are a few layers of wrapper paper, all using the same method name and signature.
ondrejmirtes commentedon Dec 25, 2018
josephzidell commentedon Dec 26, 2018
OK, will give it a whirl
ondrejmirtes commentedon Dec 27, 2018
You need to make
$class
a constructor parameter in these two classes:Then you need to specify the class in those services here (as part of
arguments
key... check PHPStan configs for how it's done):Once this change is merged, you will be able to register these services in your own
phpstan.neon
with custom classes.