| Total Complexity | 6 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class TranslationLocalesSelectorTool extends AbstractTool |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Position where should tool be placed. |
||
| 11 | */ |
||
| 12 | 1 | public function position() |
|
| 13 | { |
||
| 14 | 1 | return self::POSITION_HEADER; |
|
| 15 | } |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Unique tool identifier. |
||
| 19 | */ |
||
| 20 | 2 | public function identifier(): string |
|
| 21 | { |
||
| 22 | 2 | return 'translation_locales_selector'; |
|
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Tool's view. |
||
| 27 | */ |
||
| 28 | 1 | public function render() |
|
| 29 | { |
||
| 30 | 1 | return view('jarboe::crud.toolbar.translation_locales_selector', [ |
|
| 31 | 1 | 'tool' => $this, |
|
| 32 | 1 | 'locales' => $this->crud()->getLocales(), |
|
| 33 | ]); |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Handle tool execution. |
||
| 38 | * @param Request $request |
||
| 39 | */ |
||
| 40 | 1 | public function handle(Request $request) |
|
| 46 | ]); |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Check allowance to show and process tool. |
||
| 51 | */ |
||
| 52 | 1 | public function check(): bool |
|
| 55 | } |
||
| 56 | |||
| 57 | 1 | public function isCurrentLocale($locale) |
|
| 62 |