silverstripe-framework/control/injector/SilverStripeInjectionCreator.php

19 lines
402 B
PHP
Raw Normal View History

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