| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3.0261 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | 19 | public function create(string $className) |
|
| 29 | { |
||
| 30 | 19 | if (! isset($this->prototypes[$className])) { |
|
| 31 | 19 | if ($this->isReflectionMethodAvailable()) { |
|
| 32 | 19 | $this->prototypes[$className] = $this->getReflectionClass($className) |
|
| 33 | 19 | ->newInstanceWithoutConstructor(); |
|
| 34 | } else { |
||
| 35 | $this->prototypes[$className] = unserialize(sprintf('O:%d:"%s":0:{}', strlen($className), $className)); |
||
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 39 | 19 | return clone $this->prototypes[$className]; |
|
| 40 | } |
||
| 56 |