OSDN Git Service
(root)
/
php-libraries
/
Router.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2899e5c
)
Docblocks align
author
Jefersson Nathan
<admin@phpse.net>
Tue, 28 Apr 2015 13:40:04 +0000
(10:40 -0300)
committer
Jefersson Nathan
<admin@phpse.net>
Mon, 15 Jun 2015 13:40:04 +0000
(10:40 -0300)
src/PHPRouter/Router.php
patch
|
blob
|
history
diff --git
a/src/PHPRouter/Router.php
b/src/PHPRouter/Router.php
index
770de00
..
8986e9b
100755
(executable)
--- a/
src/PHPRouter/Router.php
+++ b/
src/PHPRouter/Router.php
@@
-26,9
+26,10
@@
use PHPRouter\RouteCollection;
class Router
{
/**
class Router
{
/**
- * Array that holds all Route objects
- * @var array
- */
+ * Array that holds all Route objects
+ *
+ * @var array
+ */
private $routes = array();
/**
private $routes = array();
/**
@@
-61,8
+62,8
@@
class Router
}
/**
}
/**
- * Matches the current request against mapped routes
- */
+
* Matches the current request against mapped routes
+
*/
public function matchCurrentRequest()
{
$requestMethod = (
public function matchCurrentRequest()
{
$requestMethod = (
@@
-88,6
+89,7
@@
class Router
*
* @param string $requestUrl
* @param string $requestMethod
*
* @param string $requestUrl
* @param string $requestMethod
+ *
* @return bool|Route
*/
public function match($requestUrl, $requestMethod = 'GET')
* @return bool|Route
*/
public function match($requestUrl, $requestMethod = 'GET')
@@
-100,7
+102,7
@@
class Router
}
// check if request _url matches route regex. if not, return false.
}
// check if request _url matches route regex. if not, return false.
- if (! preg_match("@^"
.$this->basePath.$routes->getRegex().
"*$@i", $requestUrl, $matches)) {
+ if (! preg_match("@^"
. $this->basePath . $routes->getRegex() .
"*$@i", $requestUrl, $matches)) {
continue;
}
continue;
}
@@
-135,9
+137,11
@@
class Router
*
* @param $routeName
* @param array $params Optional array of parameters to use in URL
*
* @param $routeName
* @param array $params Optional array of parameters to use in URL
+ *
* @throws Exception
*
* @internal param string $route_name The name of the route to reverse route.
* @throws Exception
*
* @internal param string $route_name The name of the route to reverse route.
+ *
* @return string The url to the route
*/
public function generate($routeName, array $params = array())
* @return string The url to the route
*/
public function generate($routeName, array $params = array())