1 | <?php |
||
19 | class AnimeClient { |
||
20 | |||
21 | use \Aviat\Ion\Di\ContainerAware; |
||
22 | |||
23 | const SESSION_SEGMENT = 'Aviat\AnimeClient\Auth'; |
||
24 | const DEFAULT_CONTROLLER_NAMESPACE = 'Aviat\AnimeClient\Controller'; |
||
25 | const DEFAULT_CONTROLLER = 'Aviat\AnimeClient\Controller\Anime'; |
||
26 | const DEFAULT_CONTROLLER_METHOD = 'index'; |
||
27 | const NOT_FOUND_METHOD = 'not_found'; |
||
28 | const ERROR_MESSAGE_METHOD = 'error_page'; |
||
29 | const SRC_DIR = __DIR__ . '/../../'; |
||
30 | |||
31 | private static $form_pages = [ |
||
32 | 'edit', |
||
33 | 'add', |
||
34 | 'update', |
||
35 | 'update_form', |
||
36 | 'login', |
||
37 | 'logout' |
||
38 | ]; |
||
39 | |||
40 | /** |
||
41 | * HTML selection helper function |
||
42 | * |
||
43 | * @param string $a - First item to compare |
||
44 | * @param string $b - Second item to compare |
||
45 | * @return string |
||
46 | */ |
||
47 | public static function is_selected($a, $b) |
||
51 | |||
52 | /** |
||
53 | * Inverse of selected helper function |
||
54 | * |
||
55 | * @param string $a - First item to compare |
||
56 | * @param string $b - Second item to compare |
||
57 | * @return string |
||
58 | */ |
||
59 | public static function is_not_selected($a, $b) |
||
63 | |||
64 | /** |
||
65 | * Decode a json file into a php data structure |
||
66 | * |
||
67 | * @param string $file |
||
68 | * @param bool $as_array |
||
69 | * @return array|object |
||
70 | */ |
||
71 | public static function json_file_decode($file, $as_array=TRUE) |
||
78 | |||
79 | /** |
||
80 | * Encode json data and save to the selected file |
||
81 | * |
||
82 | * @param string $file |
||
83 | * @param mixed $data |
||
84 | * @return bool |
||
|
|||
85 | */ |
||
86 | public static function json_file_encode($file, $data) |
||
93 | |||
94 | /** |
||
95 | * Determine whether to show the sub-menu |
||
96 | * |
||
97 | * @return bool |
||
98 | */ |
||
99 | public function is_view_page() |
||
109 | |||
110 | /** |
||
111 | * Determine whether the page is a page with a form, and |
||
112 | * not suitable for redirection |
||
113 | * |
||
114 | * @return boolean |
||
115 | */ |
||
116 | public function is_form_page() |
||
120 | |||
121 | } |
||
122 | // End of anime_client.php |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.