| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public function testSetStringOptions() |
||
| 35 | { |
||
| 36 | $trait = $this->buildMock(['setConfigs']); |
||
| 37 | $trait->expects($this->any()) |
||
|
|
|||
| 38 | ->method('setConfigs') |
||
| 39 | ->willReturnCallback(function ($configs) { |
||
| 40 | self::$setConfigs = $configs; |
||
| 41 | }); |
||
| 42 | |||
| 43 | $trait->setStringOptions('foo, bar=42'); |
||
| 44 | $this->assertEquals( |
||
| 45 | ['foo' => true, 'bar' => 42], |
||
| 46 | self::$setConfigs |
||
| 47 | ); |
||
| 48 | } |
||
| 49 | } |
||
| 50 |
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: