mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-07 18:21:23 +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);
|
|
}
|
|
} |