@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | /** |
| 116 | 116 | * Check if an response output buffering is active. |
| 117 | - * @return boolean |
|
| 117 | + * @return boolean|null |
|
| 118 | 118 | */ |
| 119 | 119 | public static function isBuffering(){ |
| 120 | 120 | return static::$buffer; |
@@ -139,7 +139,6 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | /** |
| 141 | 141 | * Append a text to the buffer. |
| 142 | - * @param mixed $payload Text to append to the response buffer |
|
| 143 | 142 | */ |
| 144 | 143 | public static function text(...$args){ |
| 145 | 144 | static::type(static::TYPE_TEXT); |
@@ -148,7 +147,6 @@ discard block |
||
| 148 | 147 | |
| 149 | 148 | /** |
| 150 | 149 | * Append an XML string to the buffer. |
| 151 | - * @param mixed $payload Data to append to the response buffer |
|
| 152 | 150 | */ |
| 153 | 151 | public static function xml(...$args){ |
| 154 | 152 | static::type(static::TYPE_XML); |
@@ -157,7 +155,6 @@ discard block |
||
| 157 | 155 | |
| 158 | 156 | /** |
| 159 | 157 | * Append a SVG string to the buffer. |
| 160 | - * @param mixed $payload Data to append to the response buffer |
|
| 161 | 158 | */ |
| 162 | 159 | public static function svg(...$args){ |
| 163 | 160 | static::type(static::TYPE_SVG); |
@@ -166,7 +163,6 @@ discard block |
||
| 166 | 163 | |
| 167 | 164 | /** |
| 168 | 165 | * Append an HTML string to the buffer. |
| 169 | - * @param mixed $payload Data to append to the response buffer |
|
| 170 | 166 | */ |
| 171 | 167 | public static function html(...$args){ |
| 172 | 168 | static::type(static::TYPE_HTML); |
@@ -181,7 +177,6 @@ discard block |
||
| 181 | 177 | * - Objects, arrays and bools will be JSON encoded |
| 182 | 178 | * - Strings and numbers will be appendend to the response |
| 183 | 179 | * |
| 184 | - * @param mixed $payload Data to append to the response buffer |
|
| 185 | 180 | */ |
| 186 | 181 | public static function add(){ |
| 187 | 182 | foreach(func_get_args() as $data){ |
@@ -198,10 +193,16 @@ discard block |
||
| 198 | 193 | } |
| 199 | 194 | } |
| 200 | 195 | |
| 196 | + /** |
|
| 197 | + * @param integer $code |
|
| 198 | + */ |
|
| 201 | 199 | public static function status($code,$message=''){ |
| 202 | 200 | static::header('Status',$message?:$code,$code); |
| 203 | 201 | } |
| 204 | 202 | |
| 203 | + /** |
|
| 204 | + * @param string $name |
|
| 205 | + */ |
|
| 205 | 206 | public static function header($name,$value,$code=null){ |
| 206 | 207 | if (empty(static::$headers[$name])){ |
| 207 | 208 | static::$headers[$name] = [[$value,$code]]; |