mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Do not call a constructor if there aren't one.
This will fix a lot of unittests failing.
This commit is contained in:
parent
cf408d766a
commit
3a11bb2f66
5
core/Object.php
Normal file → Executable file
5
core/Object.php
Normal file → Executable file
@ -85,7 +85,10 @@ abstract class Object {
|
|||||||
$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();
|
||||||
|
Loading…
Reference in New Issue
Block a user