| Total Complexity | 9 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class Metodo |
||
| 11 | { |
||
| 12 | private $_metodo; |
||
| 13 | private $_controlador; |
||
| 14 | |||
| 15 | public function __construct(Enlace $url, Controlador $controlador) |
||
| 19 | } |
||
| 20 | |||
| 21 | public function metodo(): string |
||
| 22 | { |
||
| 23 | return $this->_metodo; |
||
| 24 | } |
||
| 25 | |||
| 26 | private function setMetodo(array $array): string |
||
| 29 | } |
||
| 30 | |||
| 31 | private function elMetodoEsValido(array $array): string |
||
| 32 | { |
||
| 33 | $metodo = $this->elMetodoEstaDefinido($array); |
||
| 34 | |||
| 35 | if (!method_exists(CONTROLADOR_NAMESPACE.$this->_controlador->controlador(), $metodo)) { |
||
| 36 | return $this->elMetodoPorDefectoEsValido(); |
||
| 37 | } |
||
| 38 | |||
| 39 | return $metodo; |
||
| 40 | } |
||
| 41 | |||
| 42 | private function elMetodoEstaDefinido(array $array): string |
||
| 49 | } |
||
| 50 | |||
| 51 | private function elMetodoPorDefectoEsValido(): string |
||
| 58 | } |
||
| 59 | } |
||
| 60 |