| Total Complexity | 4 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | class CancelShortcut implements ShortcutInterface |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * @throws InvalidParamsException |
||
| 21 | */ |
||
| 22 | public function getPlugins(array $params): array |
||
| 23 | { |
||
| 24 | $typeMethod = Str::camel($params['_action'] ?? 'default').'Plugins'; |
||
| 25 | |||
| 26 | if (method_exists($this, $typeMethod)) { |
||
| 27 | return $this->{$typeMethod}(); |
||
| 28 | } |
||
| 29 | |||
| 30 | throw new InvalidParamsException(Exception::PARAMS_SHORTCUT_ACTION_INVALID, "Cancel action [{$typeMethod}] not supported"); |
||
| 31 | } |
||
| 32 | |||
| 33 | protected function defaultPlugins(): array |
||
| 41 | ]; |
||
| 42 | } |
||
| 43 | |||
| 44 | protected function qrCodePlugins(): array |
||
| 52 | ]; |
||
| 53 | } |
||
| 55 |