| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function getPlugins(array $params): array |
||
| 19 | { |
||
| 20 | $typeMethod = ($params['_type'] ?? 'default').'Plugins'; |
||
| 21 | |||
| 22 | if (isset($params['combine_out_trade_no'])) { |
||
| 23 | return $this->combinePlugins(); |
||
|
|
|||
| 24 | } |
||
| 25 | |||
| 26 | if (method_exists($this, $typeMethod)) { |
||
| 27 | return $this->{$typeMethod}(); |
||
| 28 | } |
||
| 29 | |||
| 30 | throw new InvalidParamsException(Exception::SHORTCUT_MULTI_TYPE_ERROR, "Query type [$typeMethod] not supported"); |
||
| 31 | } |
||
| 54 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: