silverstripe-framework/control/injector/SilverStripeInjectionCreator.php
2018-01-30 16:50:32 +00:00

19 lines
405 B
PHP

<?php
use SilverStripe\Framework\Injector\Factory;
/**
* @package framework
* @subpackage injector
*/
class SilverStripeInjectionCreator implements Factory {
public function create($class, array $params = array()) {
$class = SS_Object::getCustomClass($class);
$reflector = new ReflectionClass($class);
return $params ? $reflector->newInstanceArgs($params) : $reflector->newInstance();
}
}