|
@@ -102,7 +102,7 @@ discard block |
|
|
block discarded – undo |
|
102
|
102
|
* Run one of the mapped callbacks to a passed HTTP Method. |
|
103
|
103
|
* @param array $args The arguments to be passed to the callback |
|
104
|
104
|
* @param string $method The HTTP Method requested. |
|
105
|
|
- * @return array The callback response. |
|
|
105
|
+ * @return string[] The callback response. |
|
106
|
106
|
*/ |
|
107
|
107
|
public function run(array $args, $method='get'){ |
|
108
|
108
|
$method = strtolower($method); |
|
@@ -226,7 +226,6 @@ discard block |
|
|
block discarded – undo |
|
226
|
226
|
|
|
227
|
227
|
/** |
|
228
|
228
|
* Bind a middleware callback to invoked before the route definition |
|
229
|
|
- * @param callable $before The callback to be invoked ($this is binded to the route object). |
|
230
|
229
|
* @return Route |
|
231
|
230
|
*/ |
|
232
|
231
|
public function & before($callback){ |
|
@@ -350,7 +349,7 @@ discard block |
|
|
block discarded – undo |
|
350
|
349
|
* Helper for reverse routing : obtain a complete URL for a named route with passed parameters |
|
351
|
350
|
* @param string $name The name tag of the route. |
|
352
|
351
|
* @param array $params The parameter map of the route dynamic values. |
|
353
|
|
- * @return string |
|
|
352
|
+ * @return URL |
|
354
|
353
|
*/ |
|
355
|
354
|
public static function URL($name, $params = []){ |
|
356
|
355
|
return ($r = static::as($name)) ? $r-> getURL($params) : new URL(); |
|
@@ -380,7 +379,7 @@ discard block |
|
|
block discarded – undo |
|
380
|
379
|
* @param string $pattern The URL schema with the named parameters |
|
381
|
380
|
* @param string $URL The URL to process, if omitted the current request URI will be used. |
|
382
|
381
|
* @param boolean $cut If true don't limit the matching to the whole URL (used for group pattern extraction) |
|
383
|
|
- * @return array The extracted variables |
|
|
382
|
+ * @return callable The extracted variables |
|
384
|
383
|
*/ |
|
385
|
384
|
protected static function extractVariablesFromURL($pattern, $URL=null, $cut=false){ |
|
386
|
385
|
$URL = $URL ?: Request::URI(); |