| Conditions | 1 |
| Paths | 1 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 30 | public function testCreateService() |
||
| 31 | { |
||
| 32 | $this->sut->method('getCommandServiceName')->willReturn('FooBar'); |
||
| 33 | |||
| 34 | $this->serviceLocator->setService('FooBar', new Command('FooBar')); |
||
| 35 | |||
| 36 | $actual = $this->sut->createService($this->serviceLocator); |
||
|
|
|||
| 37 | |||
| 38 | self::assertInstanceOf(CheckCommand::class, $actual); |
||
| 39 | } |
||
| 40 | |||
| 53 |
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: