Merge pull request #81 from stojg/release/object-create

MINOR Object::create should not call a constructor if there aren't one.
This commit is contained in:
Sam Minnée 2011-10-28 16:34:58 -07:00
commit d88b39f292

5
core/Object.php Normal file → Executable file
View File

@ -85,7 +85,10 @@ abstract class Object {
$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();