summaryrefslogtreecommitdiffstats
path: root/system/core/Router.php
diff options
context:
space:
mode:
authorJonatas Miguel <jonatas.df.miguel@gmail.com>2012-08-06 17:37:26 +0200
committerJonatas Miguel <jonatas.df.miguel@gmail.com>2012-08-06 17:37:26 +0200
commit07264381020d730ebba9ae95688b73c25e523e54 (patch)
treea7d1dc993958633860e3c3c6d1f133f71a3d190e /system/core/Router.php
parent3b45cf62bec6684f35207a1bfb2193f1adc9cd2b (diff)
Corrected code style to be inline with project conventions.
Diffstat (limited to 'system/core/Router.php')
-rw-r--r--system/core/Router.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/system/core/Router.php b/system/core/Router.php
index d6788c314..081468944 100644
--- a/system/core/Router.php
+++ b/system/core/Router.php
@@ -377,24 +377,26 @@ class CI_Router {
$callable = ! is_string($val) && is_callable($val);
// Are we using callbacks to process back-references?
- if($callable){
+ if($callable)
+ {
// Remove the original string from the matches array.
array_shift($matches);
// Get the match count.
- $matchCount = count($matches);
+ $match_count = count($matches);
// Determine how many parameters the callback has.
$reflection = new ReflectionFunction($val);
- $paramCount = count($reflection->getParameters());
+ $param_count = count($reflection->getParameters());
// Are there more parameters than matches?
- if($paramCount > $matchCount){
- // Set any extra params to empty string.
- $matches = array_merge($matches, array_fill($matchCount, $paramCount - $matchCount, ''));
+ if($param_count > $match_count)
+ {
+ // Any params without matches will be set to an empty string.
+ $matches = array_merge($matches, array_fill($match_count, $param_count - $match_count, ''));
}
- // execute callback using matches as its parameters.
+ // Execute the callback using the values in matches as its parameters.
$val = call_user_func_array($val, $matches);
}
// Are we using the default routing method for back-references?