@@ -200,6 +200,9 @@ discard block |
||
| 200 | 200 | return false; |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | + /** |
|
| 204 | + * @param string|boolean $layout |
|
| 205 | + */ |
|
| 203 | 206 | public function setLayout($layout) |
| 204 | 207 | { |
| 205 | 208 | if ($layout === false) { |
@@ -241,6 +244,10 @@ discard block |
||
| 241 | 244 | * @return string processed content |
| 242 | 245 | */ |
| 243 | 246 | //@TODO: come back and clean up this and the way the view receives stuff |
| 247 | + |
|
| 248 | + /** |
|
| 249 | + * @param string|boolean $file |
|
| 250 | + */ |
|
| 244 | 251 | private function process($file) |
| 245 | 252 | { |
| 246 | 253 | ob_start(); |
@@ -172,7 +172,6 @@ discard block |
||
| 172 | 172 | * Attach (or remove) multiple callbacks to an event and trigger those callbacks when that event is called. |
| 173 | 173 | * |
| 174 | 174 | * @param string $event name |
| 175 | - * @param mixed $value the optional value to pass to each callback |
|
| 176 | 175 | * @param mixed $callback the method or function to call - FALSE to remove all callbacks for event |
| 177 | 176 | */ |
| 178 | 177 | |
@@ -186,6 +185,9 @@ discard block |
||
| 186 | 185 | } |
| 187 | 186 | } |
| 188 | 187 | |
| 188 | + /** |
|
| 189 | + * @param string $event |
|
| 190 | + */ |
|
| 189 | 191 | public function callEvent($event, $method = false, $arguments = []) |
| 190 | 192 | { |
| 191 | 193 | if (isset(self::$events[$event])) { |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | * |
| 144 | 144 | * Safe: a-z, 0-9, :, _, [, ], + |
| 145 | 145 | * |
| 146 | - * @param $uri |
|
| 146 | + * @param string $uri |
|
| 147 | 147 | * @param $uriChunks |
| 148 | 148 | * @return bool |
| 149 | 149 | */ |
@@ -152,6 +152,10 @@ discard block |
||
| 152 | 152 | if (!preg_match("/^[a-z0-9:_\/\.\[\]-]+$/i", $uri) |
| 153 | 153 | || array_filter( |
| 154 | 154 | $uriChunks, |
| 155 | + |
|
| 156 | + /** |
|
| 157 | + * @param string $uriChunk |
|
| 158 | + */ |
|
| 155 | 159 | function ($uriChunk) { |
| 156 | 160 | if (strpos($uriChunk, '__') !== false) { |
| 157 | 161 | return true; |
@@ -166,6 +170,10 @@ discard block |
||
| 166 | 170 | } |
| 167 | 171 | |
| 168 | 172 | //@TODO add Security class. |
| 173 | + |
|
| 174 | + /** |
|
| 175 | + * @param string $data |
|
| 176 | + */ |
|
| 169 | 177 | private function normalize($data) |
| 170 | 178 | { |
| 171 | 179 | if (is_numeric($data)) { |
@@ -242,6 +250,9 @@ discard block |
||
| 242 | 250 | return $normalizedURI; |
| 243 | 251 | } |
| 244 | 252 | |
| 253 | + /** |
|
| 254 | + * @param string $uri |
|
| 255 | + */ |
|
| 245 | 256 | private function discoverRoute($uri) |
| 246 | 257 | { |
| 247 | 258 | $routes = $this->routes; |
@@ -274,7 +285,7 @@ discard block |
||
| 274 | 285 | /** |
| 275 | 286 | * Normalize the $_SERVER vars for formatting the URI. |
| 276 | 287 | * |
| 277 | - * @param $uri |
|
| 288 | + * @param string $uri |
|
| 278 | 289 | * @access public |
| 279 | 290 | * @return string formatted/u/r/l |
| 280 | 291 | */ |
@@ -329,6 +340,9 @@ discard block |
||
| 329 | 340 | return array_merge($return, array_values($uriChunks)); |
| 330 | 341 | } |
| 331 | 342 | |
| 343 | + /** |
|
| 344 | + * @param string $url |
|
| 345 | + */ |
|
| 332 | 346 | private function addQueryString($url, $key, $value) |
| 333 | 347 | { |
| 334 | 348 | $url = preg_replace('/(.*)(\?|&)' . $key . '=[^&]+?(&)(.*)/i', '$1$2$4', $url . '&'); |
@@ -340,6 +354,9 @@ discard block |
||
| 340 | 354 | } |
| 341 | 355 | } |
| 342 | 356 | |
| 357 | + /** |
|
| 358 | + * @param string $url |
|
| 359 | + */ |
|
| 343 | 360 | private function removeQueryString($url, $key) |
| 344 | 361 | { |
| 345 | 362 | $url = preg_replace('/(.*)(\?|&)' . $key . '=[^&]+?(&)(.*)/i', '$1$2$4', $url . '&'); |
@@ -411,7 +428,7 @@ discard block |
||
| 411 | 428 | * Set optional status header, and redirect to provided URL |
| 412 | 429 | * |
| 413 | 430 | * @access public |
| 414 | - * @return bool |
|
| 431 | + * @return false|null |
|
| 415 | 432 | */ |
| 416 | 433 | public function redirect($url = '/', $status = null) |
| 417 | 434 | { |