| Total Complexity | 3 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class Factory implements FactoryInterface |
||
| 9 | { |
||
| 10 | private object $_clase; |
||
| 11 | private string $_nombreDeLaClase; |
||
| 12 | |||
| 13 | 2 | public function crear(string $nombreDeLaClase, ?array $parametros = array()): object |
|
| 14 | { |
||
| 15 | 2 | $this->_nombreDeLaClase = $this->verificarSiExisteLaClase($nombreDeLaClase); |
|
| 16 | |||
| 17 | 1 | $this->_clase = new $this->_nombreDeLaClase; |
|
| 18 | |||
| 19 | 1 | return $this->_clase->crear($parametros); |
|
| 20 | } |
||
| 21 | |||
| 22 | 2 | private function verificarSiExisteLaClase(string $nombreDeLaClase): string |
|
| 29 | } |
||
| 30 | } |
||
| 31 |