We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
1 | <?php |
||
5 | trait Tabs |
||
6 | { |
||
7 | public $tabsEnabled = false; |
||
8 | public $tabsType = 'horizontal'; |
||
9 | |||
10 | 9 | public function enableTabs() |
|
17 | |||
18 | 2 | public function disableTabs() |
|
24 | |||
25 | 8 | public function tabsEnabled() |
|
29 | |||
30 | 1 | public function tabsDisabled() |
|
34 | |||
35 | 14 | public function setTabsType($type) |
|
41 | |||
42 | 5 | public function getTabsType() |
|
46 | |||
47 | 1 | public function enableVerticalTabs() |
|
51 | |||
52 | 1 | public function disableVerticalTabs() |
|
56 | |||
57 | 1 | public function enableHorizontalTabs() |
|
61 | |||
62 | 1 | public function disableHorizontalTabs() |
|
66 | |||
67 | 3 | public function tabExists($label) |
|
73 | |||
74 | 4 | public function getLastTab() |
|
84 | |||
85 | 2 | public function isLastTab($label) |
|
89 | |||
90 | 1 | public function getTabFields($label) |
|
91 | { |
||
92 | 1 | if ($this->tabExists($label)) { |
|
93 | $all_fields = $this->getCurrentFields(); |
||
94 | |||
95 | $fields_for_current_tab = collect($all_fields)->filter(function ($value, $key) use ($label) { |
||
96 | return isset($value['tab']) && $value['tab'] == $label; |
||
97 | }); |
||
98 | |||
99 | if ($this->isLastTab($label)) { |
||
100 | $fields_without_a_tab = collect($all_fields)->filter(function ($value, $key) { |
||
101 | return ! isset($value['tab']); |
||
102 | }); |
||
103 | |||
104 | $fields_for_current_tab = $fields_for_current_tab->merge($fields_without_a_tab); |
||
105 | } |
||
106 | |||
107 | return $fields_for_current_tab; |
||
108 | } |
||
109 | |||
110 | 1 | return []; |
|
111 | } |
||
112 | |||
113 | 9 | public function getTabs() |
|
130 | } |
||
131 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@return
annotation as described here.