Add return types

This commit is contained in:
Pierre Rudloff 2020-12-17 22:43:05 +01:00
parent f2785bca03
commit 05311ac7b6
21 changed files with 84 additions and 78 deletions

View file

@ -26,7 +26,7 @@ class UglyRouter extends Router
*
* @link https://github.com/nikic/FastRoute/blob/master/src/Dispatcher.php
*/
public function dispatch(ServerRequestInterface $request)
public function dispatch(ServerRequestInterface $request): array
{
$params = $request->getQueryParams();
$uri = new Uri('', '');
@ -53,7 +53,7 @@ class UglyRouter extends Router
* @throws InvalidArgumentException If required data not provided
* @throws RuntimeException If named route does not exist
*/
public function pathFor($name, array $data = [], array $queryParams = [])
public function pathFor($name, array $data = [], array $queryParams = []): string
{
$queryParams['page'] = $name;
$url = Uri::createFromString($this->relativePathFor($name, $data, $queryParams))->withPath('');