Browse files

MINOR Do not call a constructor if there aren't one.

This will fix a lot of unittests failing.
  • Loading branch information...
1 parent cf408d7 commit 3a11bb2f6696fb29716126cdffdf131b5cea3921 @stojg stojg committed Oct 27, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 core/Object.php
View
5 core/Object.php 100644 → 100755
@@ -85,7 +85,10 @@ public static function create() {
$args = func_get_args();
$class = self::getCustomClass(array_shift($args));
$reflector = new ReflectionClass($class);
- return $reflector->newInstanceArgs($args);
+ if($reflector->getConstructor()) {
+ return $reflector->newInstanceArgs($args);
+ }
+ return new $class;
}
private static $_cache_inst_args = array();

0 comments on commit 3a11bb2

Please sign in to comment.