Total Complexity | 4 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | class RefundShortcut implements ShortcutInterface |
||
20 | { |
||
21 | /** |
||
22 | * @throws InvalidParamsException |
||
23 | */ |
||
24 | public function getPlugins(array $params): array |
||
25 | { |
||
26 | $method = Str::camel($params['_action'] ?? 'default').'Plugins'; |
||
27 | |||
28 | if (method_exists($this, $method)) { |
||
29 | return $this->{$method}(); |
||
30 | } |
||
31 | |||
32 | throw new InvalidParamsException(Exception::PARAMS_SHORTCUT_ACTION_INVALID, "您所提供的 action 方法 [{$method}] 不支持,请参考文档或源码确认"); |
||
33 | } |
||
34 | |||
35 | protected function defaultPlugins(): array |
||
36 | { |
||
37 | return $this->miniPlugins(); |
||
38 | } |
||
39 | |||
40 | protected function miniPlugins(): array |
||
50 | ]; |
||
51 | } |
||
52 | } |
||
53 |