mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-08-27 21:15:40 +02:00
22 lines
476 B
PHP
22 lines
476 B
PHP
|
<?php
|
||
|
|
||
|
/**
|
||
|
* @package framework
|
||
|
* @subpackage injector
|
||
|
*/
|
||
|
|
||
|
class SilverStripeInjectionCreator {
|
||
|
/**
|
||
|
*
|
||
|
* @param string $object
|
||
|
* A string representation of the class to create
|
||
|
* @param array $params
|
||
|
* An array of parameters to be passed to the constructor
|
||
|
*/
|
||
|
public function create($class, $params = array()) {
|
||
|
$class = Object::getCustomClass($class);
|
||
|
$reflector = new ReflectionClass($class);
|
||
|
|
||
|
return $reflector->newInstanceArgs($params);
|
||
|
}
|
||
|
}
|