Conditions | 1 |
Paths | 1 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | public function testCallingFactoryReturnsHelperInstance() |
||
34 | { |
||
35 | $factory = new FilesystemHelperFactory(); |
||
36 | $this->assertInstanceOf(FilesystemHelperFactory::class, $factory); |
||
37 | |||
38 | $class = $factory($this->container->reveal()); |
||
|
|||
39 | |||
40 | $this->assertInstanceOf(FilesystemHelper::class, $class); |
||
41 | } |
||
42 | } |
||
43 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: