mirror of
https://github.com/dannyvankooten/AltoRouter.git
synced 2025-07-31 13:40:16 +02:00
Add @throws
declaration to method that can throw an Exception.
This commit is contained in:
@@ -46,6 +46,7 @@ class AltoRouter {
|
|||||||
* @param array $routes
|
* @param array $routes
|
||||||
* @return void
|
* @return void
|
||||||
* @author Koen Punt
|
* @author Koen Punt
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function addRoutes($routes){
|
public function addRoutes($routes){
|
||||||
if(!is_array($routes) && !$routes instanceof Traversable) {
|
if(!is_array($routes) && !$routes instanceof Traversable) {
|
||||||
@@ -80,6 +81,7 @@ class AltoRouter {
|
|||||||
* @param string $route The route regex, custom regex must start with an @. You can use multiple pre-set regex filters, like [i:id]
|
* @param string $route The route regex, custom regex must start with an @. You can use multiple pre-set regex filters, like [i:id]
|
||||||
* @param mixed $target The target where this route should point to. Can be anything.
|
* @param mixed $target The target where this route should point to. Can be anything.
|
||||||
* @param string $name Optional name of this route. Supply if you want to reverse route this url in your application.
|
* @param string $name Optional name of this route. Supply if you want to reverse route this url in your application.
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function map($method, $route, $target, $name = null) {
|
public function map($method, $route, $target, $name = null) {
|
||||||
|
|
||||||
@@ -105,6 +107,7 @@ class AltoRouter {
|
|||||||
* @param string $routeName The name of the route.
|
* @param string $routeName The name of the route.
|
||||||
* @param array @params Associative array of parameters to replace placeholders with.
|
* @param array @params Associative array of parameters to replace placeholders with.
|
||||||
* @return string The URL of the route with named parameters in place.
|
* @return string The URL of the route with named parameters in place.
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function generate($routeName, array $params = array()) {
|
public function generate($routeName, array $params = array()) {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user