| Conditions | 4 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function getPlugins(array $params): array |
||
| 23 | { |
||
| 24 | if (isset($params['combine_out_trade_no']) || isset($params['sub_orders'])) { |
||
| 25 | return $this->combinePlugins(); |
||
|
|
|||
| 26 | } |
||
| 27 | |||
| 28 | $typeMethod = Str::camel($params['_action'] ?? 'default').'Plugins'; |
||
| 29 | |||
| 30 | if (method_exists($this, $typeMethod)) { |
||
| 31 | return $this->{$typeMethod}(); |
||
| 32 | } |
||
| 33 | |||
| 34 | throw new InvalidParamsException(Exception::PARAMS_SHORTCUT_ACTION_INVALID, "Query action [{$typeMethod}] not supported"); |
||
| 35 | } |
||
| 59 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: