Skip to content

Commit

Permalink
MINOR Do not call a constructor if there aren't one.
Browse files Browse the repository at this point in the history
This will fix a lot of unittests failing.
  • Loading branch information
Stig Lindqvist committed Oct 27, 2011
1 parent cf408d7 commit 3a11bb2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/Object.php 100644 → 100755
Expand Up @@ -85,7 +85,10 @@ public static function create() {
$args = func_get_args(); $args = func_get_args();
$class = self::getCustomClass(array_shift($args)); $class = self::getCustomClass(array_shift($args));
$reflector = new ReflectionClass($class); $reflector = new ReflectionClass($class);
return $reflector->newInstanceArgs($args); if($reflector->getConstructor()) {
return $reflector->newInstanceArgs($args);
}
return new $class;
} }


private static $_cache_inst_args = array(); private static $_cache_inst_args = array();
Expand Down

0 comments on commit 3a11bb2

Please sign in to comment.