1 | <?php declare(strict_types=1); |
||
26 | class Util { |
||
27 | |||
28 | use ContainerAware; |
||
29 | |||
30 | /** |
||
31 | * Routes that don't require a second navigation level |
||
32 | * @var array |
||
33 | */ |
||
34 | private static $form_pages = [ |
||
35 | 'edit', |
||
36 | 'add', |
||
37 | 'update', |
||
38 | 'update_form', |
||
39 | 'login', |
||
40 | 'logout', |
||
41 | 'details' |
||
42 | ]; |
||
43 | |||
44 | /** |
||
45 | * The config manager |
||
46 | * @var ConfigInterface |
||
47 | */ |
||
48 | private $config; |
||
49 | |||
50 | /** |
||
51 | * Set up the Util class |
||
52 | * |
||
53 | * @param ContainerInterface $container |
||
|
|||
54 | */ |
||
55 | public function __construct(ContainerInterface $container) |
||
60 | |||
61 | /** |
||
62 | * HTML selection helper function |
||
63 | * |
||
64 | * @param string $a - First item to compare |
||
65 | * @param string $b - Second item to compare |
||
66 | * @return string |
||
67 | */ |
||
68 | public static function is_selected($a, $b) |
||
72 | |||
73 | /** |
||
74 | * Inverse of selected helper function |
||
75 | * |
||
76 | * @param string $a - First item to compare |
||
77 | * @param string $b - Second item to compare |
||
78 | * @return string |
||
79 | */ |
||
80 | public static function is_not_selected($a, $b) |
||
84 | |||
85 | /** |
||
86 | * Determine whether to show the sub-menu |
||
87 | * |
||
88 | * @return bool |
||
89 | */ |
||
90 | public function is_view_page() |
||
100 | |||
101 | /** |
||
102 | * Determine whether the page is a page with a form, and |
||
103 | * not suitable for redirection |
||
104 | * |
||
105 | * @return boolean |
||
106 | */ |
||
107 | public function is_form_page() |
||
111 | } |
||
112 | |||
113 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.