| Total Complexity | 4 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | class PosShortcut implements ShortcutInterface |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @throws InvalidParamsException |
||
| 22 | */ |
||
| 23 | public function getPlugins(array $params): array |
||
| 24 | { |
||
| 25 | $typeMethod = Str::camel($params['_action'] ?? 'default').'Plugins'; |
||
| 26 | |||
| 27 | if (method_exists($this, $typeMethod)) { |
||
| 28 | return $this->{$typeMethod}(); |
||
| 29 | } |
||
| 30 | |||
| 31 | throw new InvalidParamsException(Exception::PARAMS_SHORTCUT_ACTION_INVALID, "Pos action [{$typeMethod}] not supported"); |
||
| 32 | } |
||
| 33 | |||
| 34 | protected function defaultPlugins(): array |
||
| 35 | { |
||
| 36 | return [ |
||
| 37 | PreparePlugin::class, |
||
| 38 | PosNormalPlugin::class, |
||
| 39 | RadarSignPlugin::class, |
||
| 40 | LaunchPlugin::class, |
||
| 41 | ParserPlugin::class, |
||
| 42 | ]; |
||
| 43 | } |
||
| 44 | |||
| 45 | protected function preAuthPlugins(): array |
||
| 53 | ]; |
||
| 54 | } |
||
| 55 | } |
||
| 56 |