class Router
{
/**
- * Array that holds all Route objects
+ * RouteCollection that holds all Route objects
*
- * @var array
+ * @var RouteCollection
*/
private $routes = array();
if (!preg_match("@^" . $this->basePath . $routes->getRegex() . "*$@i", $requestUrl, $matches)) {
continue;
}
+ $matchedText = array_shift($matches);
$params = array();
// grab array with matches
$argument_keys = $argument_keys[1];
+ // check arguments number
+ if(count($argument_keys) != count($matches)) {
+ continue;
+ }
+
// loop trough parameter names, store matching value in $params array
foreach ($argument_keys as $key => $name) {
if (isset($matches[$key + 1])) {