Total Complexity | 15 |
Total Lines | 65 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class SidebarItemHelper extends MenuItemHelper |
||
6 | { |
||
7 | /** |
||
8 | * Check if a menu item is a sidebar custom search bar. |
||
9 | * |
||
10 | * @param mixed $item |
||
11 | * @return bool |
||
12 | */ |
||
13 | 50 | public static function isCustomSearch($item) |
|
17 | } |
||
18 | |||
19 | /** |
||
20 | * Check if a menu item is a sidebar menu search bar. |
||
21 | * |
||
22 | * @param mixed $item |
||
23 | * @return bool |
||
24 | */ |
||
25 | 50 | public static function isMenuSearch($item) |
|
29 | } |
||
30 | |||
31 | /** |
||
32 | * Check if a menu item is a sidebar search item (legacy or new). |
||
33 | * |
||
34 | * @param mixed $item |
||
35 | * @return bool |
||
36 | */ |
||
37 | 50 | public static function isSearch($item) |
|
38 | { |
||
39 | 50 | return self::isLegacySearch($item) || |
|
40 | 50 | self::isCustomSearch($item) || |
|
41 | 50 | self::isMenuSearch($item); |
|
42 | } |
||
43 | |||
44 | /** |
||
45 | * Check if a menu item is accepted for the sidebar section. |
||
46 | * |
||
47 | * @param mixed $item |
||
48 | * @return bool |
||
49 | */ |
||
50 | 18 | public static function isAcceptedItem($item) |
|
56 | } |
||
57 | |||
58 | /** |
||
59 | * Check if a menu item is valid for the sidebar. |
||
60 | * |
||
61 | * @param mixed $item |
||
62 | * @return bool |
||
63 | */ |
||
64 | 18 | public static function isValidItem($item) |
|
72 |