| Total Complexity | 11 |
| Total Lines | 58 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class MenuItemHelper |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Check if a menu item is a header. |
||
| 14 | * |
||
| 15 | * @param mixed $item |
||
| 16 | * @return bool |
||
| 17 | */ |
||
| 18 | 52 | public static function isHeader($item) |
|
| 19 | { |
||
| 20 | 52 | return is_string($item) || isset($item['header']); |
|
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Check if a menu item is a link. |
||
| 25 | * |
||
| 26 | * @param mixed $item |
||
| 27 | * @return bool |
||
| 28 | */ |
||
| 29 | 4 | public static function isLink($item) |
|
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Check if a menu item is a submenu. |
||
| 37 | * |
||
| 38 | * @param mixed $item |
||
| 39 | * @return bool |
||
| 40 | */ |
||
| 41 | 56 | public static function isSubmenu($item) |
|
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Check if a menu item is a legacy search bar. |
||
| 49 | * |
||
| 50 | * @param mixed $item |
||
| 51 | * @return bool |
||
| 52 | */ |
||
| 53 | 54 | public static function isLegacySearch($item) |
|
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Check if a menu item is allowed to be shown (not restricted). |
||
| 61 | * |
||
| 62 | * @param mixed $item |
||
| 63 | * @return bool |
||
| 64 | */ |
||
| 65 | 56 | public static function isAllowed($item) |
|
| 70 |