Conditions | 3 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
15 | public function createInstance( |
||
16 | $class, $useParameter = false, $parameter = null |
||
17 | ) |
||
18 | { |
||
19 | if (isset($this->classMap[$class])) { |
||
20 | $class = $this->classMap[$class]; |
||
21 | } |
||
22 | if ($useParameter) { |
||
23 | return new $class($parameter); |
||
24 | } else { |
||
25 | return (new \ReflectionClass($class))->newInstanceWithoutConstructor(); |
||
26 | } |
||
27 | } |
||
28 | |||
29 | } |