diff --git a/src/Pecee/SimpleRouter/Route/LoadableRoute.php b/src/Pecee/SimpleRouter/Route/LoadableRoute.php index 6580d39..4321a2d 100644 --- a/src/Pecee/SimpleRouter/Route/LoadableRoute.php +++ b/src/Pecee/SimpleRouter/Route/LoadableRoute.php @@ -103,7 +103,7 @@ abstract class LoadableRoute extends Route implements ILoadableRoute } } - $url .= '/' . join('/', $unknownParams); + $url .= join('/', $unknownParams); return rtrim($url, '/') . '/'; } diff --git a/src/Pecee/SimpleRouter/Router.php b/src/Pecee/SimpleRouter/Router.php index def8c78..5b382e8 100644 --- a/src/Pecee/SimpleRouter/Router.php +++ b/src/Pecee/SimpleRouter/Router.php @@ -384,7 +384,7 @@ class Router * @param array|null $getParams * @return string */ - public function getUrl($name = null, $parameters = null, array $getParams = null) + public function getUrl($name = null, $parameters = null, $getParams = []) { if ($getParams !== null && is_array($getParams) === false) { throw new \InvalidArgumentException('Invalid type for getParams. Must be array or null'); diff --git a/src/Pecee/SimpleRouter/SimpleRouter.php b/src/Pecee/SimpleRouter/SimpleRouter.php index ff41352..e6b9fb6 100644 --- a/src/Pecee/SimpleRouter/SimpleRouter.php +++ b/src/Pecee/SimpleRouter/SimpleRouter.php @@ -306,37 +306,12 @@ class SimpleRouter * You can also use the same syntax when searching for a specific controller-class "MyController@home". * If no arguments is specified, it will return the url for the current loaded route. * - * This method is an alias for SimpleRouter::getUrl(). - * - * @see SimpleRouter::getUrl() * @param string|null $name * @param string|array|null $parameters * @param array|null $getParams * @return string */ - public static function getRoute($name = null, $parameters = null, array $getParams = null) - { - return static::getUrl($name, $parameters, $getParams); - } - - /** - * Get url for a route by using either name/alias, class or method name. - * - * The name parameter supports the following values: - * - Route name - * - Controller/resource name (with or without method) - * - Controller class name - * - * When searching for controller/resource by name, you can use this syntax "route.name@method". - * You can also use the same syntax when searching for a specific controller-class "MyController@home". - * If no arguments is specified, it will return the url for the current loaded route. - * - * @param string|null $name - * @param string|array|null $parameters - * @param array|null $getParams - * @return string - */ - public static function getUrl($name = null, $parameters = null, array $getParams = null) + public static function getUrl($name = null, $parameters = null, $getParams = []) { return static::router()->getUrl($name, $parameters, $getParams); }