@@ -122,6 +122,9 @@ discard block |
||
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | |
| 125 | + /** |
|
| 126 | + * @param string $uri |
|
| 127 | + */ |
|
| 125 | 128 | private function isURIClean($uri, $uriChunks) |
| 126 | 129 | { |
| 127 | 130 | if (!preg_match("/^[a-z0-9:_\/\.\[\]-]+$/i", $uri) |
@@ -138,6 +141,10 @@ discard block |
||
| 138 | 141 | } |
| 139 | 142 | |
| 140 | 143 | //@TODO add Security class. |
| 144 | + |
|
| 145 | + /** |
|
| 146 | + * @param string $data |
|
| 147 | + */ |
|
| 141 | 148 | private function normalize($data) |
| 142 | 149 | { |
| 143 | 150 | if (is_numeric($data)) { |
@@ -218,6 +225,9 @@ discard block |
||
| 218 | 225 | return $normalizedURI; |
| 219 | 226 | } |
| 220 | 227 | |
| 228 | + /** |
|
| 229 | + * @param string $uri |
|
| 230 | + */ |
|
| 221 | 231 | private function discoverRoute($uri) |
| 222 | 232 | { |
| 223 | 233 | $routes = $this->configuration->routes; |
@@ -249,6 +259,7 @@ discard block |
||
| 249 | 259 | * Normalize the $_SERVER vars for formatting the URI. |
| 250 | 260 | * |
| 251 | 261 | * @access public |
| 262 | + * @param string $uri |
|
| 252 | 263 | * @return string formatted/u/r/l |
| 253 | 264 | */ |
| 254 | 265 | private function uri($uri) |
@@ -307,6 +318,9 @@ discard block |
||
| 307 | 318 | return array_merge($return, array_values($uriChunks)); |
| 308 | 319 | } |
| 309 | 320 | |
| 321 | + /** |
|
| 322 | + * @param string $url |
|
| 323 | + */ |
|
| 310 | 324 | private function addQueryString($url, $key, $value) |
| 311 | 325 | { |
| 312 | 326 | $url = preg_replace('/(.*)(\?|&)' . $key . '=[^&]+?(&)(.*)/i', '$1$2$4', $url . '&'); |
@@ -318,6 +332,9 @@ discard block |
||
| 318 | 332 | } |
| 319 | 333 | } |
| 320 | 334 | |
| 335 | + /** |
|
| 336 | + * @param string $url |
|
| 337 | + */ |
|
| 321 | 338 | private function removeQueryString($url, $key) |
| 322 | 339 | { |
| 323 | 340 | $url = preg_replace('/(.*)(\?|&)' . $key . '=[^&]+?(&)(.*)/i', '$1$2$4', $url . '&'); |
@@ -392,7 +409,7 @@ discard block |
||
| 392 | 409 | * Set optional status header, and redirect to provided URL |
| 393 | 410 | * |
| 394 | 411 | * @access public |
| 395 | - * @return bool |
|
| 412 | + * @return false|null |
|
| 396 | 413 | */ |
| 397 | 414 | public function redirect($url = '/', $status = null) |
| 398 | 415 | { |
@@ -162,6 +162,9 @@ |
||
| 162 | 162 | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | + /** |
|
| 166 | + * @param string $sessionId |
|
| 167 | + */ |
|
| 165 | 168 | public function destroy($sessionId) |
| 166 | 169 | { |
| 167 | 170 | $success = false; |
@@ -214,6 +214,9 @@ discard block |
||
| 214 | 214 | } |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | + /** |
|
| 218 | + * @param string $service |
|
| 219 | + */ |
|
| 217 | 220 | public function setService($service, $class) |
| 218 | 221 | { |
| 219 | 222 | if($this->services === null) { |
@@ -225,6 +228,7 @@ discard block |
||
| 225 | 228 | |
| 226 | 229 | /** |
| 227 | 230 | * @param mixed string with reference to config |
| 231 | + * @param string $config |
|
| 228 | 232 | * @return mixed bool or config values |
| 229 | 233 | */ |
| 230 | 234 | public function getConfiguration($config = null) |
@@ -342,7 +346,6 @@ discard block |
||
| 342 | 346 | * Attach (or remove) multiple callbacks to an event and trigger those callbacks when that event is called. |
| 343 | 347 | * |
| 344 | 348 | * @param string $event name |
| 345 | - * @param mixed $value the optional value to pass to each callback |
|
| 346 | 349 | * @param mixed $callback the method or function to call - FALSE to remove all callbacks for event |
| 347 | 350 | */ |
| 348 | 351 | |
@@ -356,6 +359,9 @@ discard block |
||
| 356 | 359 | } |
| 357 | 360 | } |
| 358 | 361 | |
| 362 | + /** |
|
| 363 | + * @param string $event |
|
| 364 | + */ |
|
| 359 | 365 | public function callEvent($event, $method = false, $arguments = []) |
| 360 | 366 | { |
| 361 | 367 | if (isset(self::$events[$event])) { |
@@ -90,8 +90,6 @@ discard block |
||
| 90 | 90 | * |
| 91 | 91 | * @access public |
| 92 | 92 | * |
| 93 | - * @param string $requestedView relative path for the view |
|
| 94 | - * @param string $renderName array of data to expose to view |
|
| 95 | 93 | * |
| 96 | 94 | * @throws \Exception when a view can not be found |
| 97 | 95 | */ |
@@ -181,6 +179,10 @@ discard block |
||
| 181 | 179 | * @return string processed content |
| 182 | 180 | */ |
| 183 | 181 | //@TODO: come back and clean up this and the way the view receives stuff |
| 182 | + |
|
| 183 | + /** |
|
| 184 | + * @param string|boolean $file |
|
| 185 | + */ |
|
| 184 | 186 | private function process($file) |
| 185 | 187 | { |
| 186 | 188 | ob_start(); |