@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | if (!is_string($query) && !method_exists($query, '__toString')) { |
| 244 | 244 | throw new InvalidArgumentException('Uri query must be a string'); |
| 245 | 245 | } |
| 246 | - $query = ltrim((string)$query, '?'); |
|
| 246 | + $query = ltrim((string) $query, '?'); |
|
| 247 | 247 | $clone = clone $this; |
| 248 | 248 | $clone->query = $this->filterQuery($query); |
| 249 | 249 | |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | if (!is_string($fragment) && !method_exists($fragment, '__toString')) { |
| 259 | 259 | throw new InvalidArgumentException('Uri fragment must be a string'); |
| 260 | 260 | } |
| 261 | - $fragment = ltrim((string)$fragment, '#'); |
|
| 261 | + $fragment = ltrim((string) $fragment, '#'); |
|
| 262 | 262 | $clone = clone $this; |
| 263 | 263 | $clone->fragment = $this->filterQuery($fragment); |
| 264 | 264 | |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | { |
| 344 | 344 | return preg_replace_callback( |
| 345 | 345 | '/(?:[^a-zA-Z0-9_\-\.~:@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/', |
| 346 | - function ($match) { |
|
| 346 | + function($match) { |
|
| 347 | 347 | return rawurlencode($match[0]); |
| 348 | 348 | }, |
| 349 | 349 | $path |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | { |
| 362 | 362 | return preg_replace_callback( |
| 363 | 363 | '/(?:[^a-zA-Z0-9_\-\.~!\$&\'\(\)\*\+,;=%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/', |
| 364 | - function ($match) { |
|
| 364 | + function($match) { |
|
| 365 | 365 | return rawurlencode($match[0]); |
| 366 | 366 | }, |
| 367 | 367 | $query |
@@ -486,7 +486,7 @@ |
||
| 486 | 486 | * @access public |
| 487 | 487 | * @static |
| 488 | 488 | * @param string $uri |
| 489 | - * @return Resilient\Http\Uri |
|
| 489 | + * @return Uri |
|
| 490 | 490 | */ |
| 491 | 491 | public static function createFromString(string $uri) |
| 492 | 492 | { |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | * |
| 163 | 163 | * @access public |
| 164 | 164 | * @param Dispatcher $dispatcher |
| 165 | - * @return void |
|
| 165 | + * @return Router |
|
| 166 | 166 | */ |
| 167 | 167 | public function setDispatcher(Dispatcher $dispatcher) |
| 168 | 168 | { |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | * |
| 177 | 177 | * @access public |
| 178 | 178 | * @param CacheInterface $cacheEngine |
| 179 | - * @return void |
|
| 179 | + * @return Router |
|
| 180 | 180 | */ |
| 181 | 181 | public function setCacheEngine(CacheInterface $cacheEngine) |
| 182 | 182 | { |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | * |
| 191 | 191 | * @access public |
| 192 | 192 | * @param int $cacheTtl |
| 193 | - * @return void |
|
| 193 | + * @return Router |
|
| 194 | 194 | */ |
| 195 | 195 | public function setCacheTtl(int $cacheTtl) |
| 196 | 196 | { |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | * |
| 205 | 205 | * @access public |
| 206 | 206 | * @param string $cacheKey |
| 207 | - * @return void |
|
| 207 | + * @return Router |
|
| 208 | 208 | */ |
| 209 | 209 | public function setCacheKey(string $cacheKey) |
| 210 | 210 | { |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | * @access public |
| 242 | 242 | * @param array $method |
| 243 | 243 | * @param array $routes |
| 244 | - * @return void |
|
| 244 | + * @return Router |
|
| 245 | 245 | */ |
| 246 | 246 | public function setRoutes(array $method, array $routes) |
| 247 | 247 | { |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | * @param string $method |
| 299 | 299 | * @param string $pattern |
| 300 | 300 | * @param mixed $handler |
| 301 | - * @return new Route |
|
| 301 | + * @return Route Route |
|
| 302 | 302 | */ |
| 303 | 303 | protected function createRoute(string $method, string $pattern, $handler) |
| 304 | 304 | { |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | * |
| 423 | 423 | * @access public |
| 424 | 424 | * @param callable $callable |
| 425 | - * @return void |
|
| 425 | + * @return Router |
|
| 426 | 426 | */ |
| 427 | 427 | public function whenNotFound(callable $callable) |
| 428 | 428 | { |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | * |
| 437 | 437 | * @access public |
| 438 | 438 | * @param callable $callable |
| 439 | - * @return void |
|
| 439 | + * @return Router |
|
| 440 | 440 | */ |
| 441 | 441 | public function whenForbidden(callable $callable) |
| 442 | 442 | { |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | return $this->dispatcher; |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | - $routeDefinitionCallback = function (RouteCollector $r) { |
|
| 357 | + $routeDefinitionCallback = function(RouteCollector $r) { |
|
| 358 | 358 | foreach ($this->getRoutes() as $route) { |
| 359 | 359 | $r->addRoute($route->getMethod(), $route->getPattern(), $route->getIdentifier()); |
| 360 | 360 | } |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | $uri->getPath() |
| 383 | 383 | ); |
| 384 | 384 | |
| 385 | - $functionHandler = function ($arg) use ($uri, $method) { |
|
| 385 | + $functionHandler = function($arg) use ($uri, $method) { |
|
| 386 | 386 | if (method_exists($this, $arg['methodName']) || $this->hasMethod($arg['methodName'])) { |
| 387 | 387 | return $this->{$arg['methodName']}(...$arg['args']); |
| 388 | 388 | } else { |