Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch '1.9' of git.corneltek.com:php/Roller into 1.9

  • Loading branch information...
commit 43fef31745d9b9409c09d9170ad34b808d11165d 2 parents 251be83 + 4c7ff3f
@c9s authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 src/Roller/MatchedRoute.php
View
7 src/Roller/MatchedRoute.php
@@ -73,7 +73,7 @@ public function createObjectFromReflection($class = null,$args = null,$rc = null
if( ! $rc ) {
$rc = new ReflectionClass($class);
}
- return $args ? $rc->newInstanceArgs($args) : $rc->newInstance();
+ return $args && is_array($args) ? $rc->newInstanceArgs(array($args)) : $rc->newInstance();
}
public function getCallbackParameters($callback)
@@ -118,11 +118,10 @@ public function initCallback( & $cb, $args)
return $rc->getMethod($cb[1])->getParameters();
}
- elseif( is_a($cb,'Roller\Controller') ) {
+ elseif( is_a($cb,'Roller\Controller',true) ) { # allow string
$rc = new ReflectionClass( $cb );
$rm = $rc->getMethod('run');
$rps = $rm->getParameters();
-
$this->controller = $this->createObjectFromReflection( $cb , $args , $rc );
// rebuild callback array
@@ -134,7 +133,7 @@ public function initCallback( & $cb, $args)
return $rf->getParameters();
}
else {
- throw new Exception('Unsupported callback type');
+ throw new Exception('Unsupported route type');
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.