1 | <?php |
||
14 | class Header |
||
15 | { |
||
16 | /** |
||
17 | * init the class |
||
18 | * |
||
19 | * @since 3.3.0 |
||
20 | */ |
||
21 | |||
22 | public static function init() |
||
32 | |||
33 | /** |
||
34 | * add the header |
||
35 | * |
||
36 | * @since 3.3.0 |
||
37 | * |
||
38 | * @param string|array $header |
||
39 | * @param bool $replace |
||
40 | * |
||
41 | * @return bool |
||
42 | */ |
||
43 | |||
44 | public static function add($header = null, bool $replace = true) : bool |
||
57 | |||
58 | /** |
||
59 | * remove the header |
||
60 | * |
||
61 | * @since 3.3.0 |
||
62 | * |
||
63 | * @param string|array $header |
||
64 | * |
||
65 | * @return bool |
||
66 | */ |
||
67 | |||
68 | public static function remove($header = null) : bool |
||
80 | |||
81 | /** |
||
82 | * is header sent |
||
83 | * |
||
84 | * @since 3.3.0 |
||
85 | * |
||
86 | * @return bool |
||
87 | */ |
||
88 | |||
89 | public static function isSent() : bool |
||
93 | |||
94 | /** |
||
95 | * get the header array |
||
96 | * |
||
97 | * @since 3.3.0 |
||
98 | * |
||
99 | * @return array |
||
100 | */ |
||
101 | |||
102 | public static function getArray() : array |
||
106 | |||
107 | /** |
||
108 | * status code |
||
109 | * |
||
110 | * @since 3.3.0 |
||
111 | * |
||
112 | * @param int $code |
||
113 | * |
||
114 | * @return int |
||
115 | */ |
||
116 | |||
117 | public static function statusCode(int $code = null) : int |
||
121 | |||
122 | /** |
||
123 | * redirect to location |
||
124 | * |
||
125 | * @since 3.3.0 |
||
126 | * |
||
127 | * @param string $location |
||
128 | * |
||
129 | * @return bool |
||
130 | */ |
||
131 | |||
132 | public static function doRedirect(string $location = null) : bool |
||
136 | |||
137 | /** |
||
138 | * content type |
||
139 | * |
||
140 | * @since 3.3.0 |
||
141 | * |
||
142 | * @param string $type |
||
143 | * |
||
144 | * @return bool |
||
145 | */ |
||
146 | |||
147 | public static function contentType(string $type = null) : bool |
||
151 | } |
||
152 |