| Conditions | 2 |
| Paths | 2 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function _before() |
||
| 15 | { |
||
| 16 | if (!class_exists('Lurker\\ResourceWatcher')) { |
||
| 17 | $this->resourceWatcher = test::spec( |
||
|
|
|||
| 18 | 'Lurker\ResourceWatcher', |
||
| 19 | [ |
||
| 20 | 'start' => true, |
||
| 21 | 'track' => true, |
||
| 22 | 'addListener' => true |
||
| 23 | ] |
||
| 24 | )->make(); |
||
| 25 | } else { |
||
| 26 | $this->resourceWatcher = test::double( |
||
| 27 | 'Lurker\ResourceWatcher', |
||
| 28 | [ |
||
| 29 | 'start' => true, |
||
| 30 | 'track' => true, |
||
| 31 | 'addListener' => true |
||
| 32 | ] |
||
| 33 | ); |
||
| 34 | } |
||
| 35 | } |
||
| 36 | |||
| 70 |
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: