| Total Complexity | 12 |
| Total Lines | 70 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class ValidadorDeParametrosWhere implements ValidadorDeParametrosInterface |
||
| 8 | { |
||
| 9 | private $_operadoresValidos = [ |
||
| 10 | '=', |
||
| 11 | '>', |
||
| 12 | '<', |
||
| 13 | '>=', |
||
| 14 | '<=', |
||
| 15 | '<>', |
||
| 16 | '!=', |
||
| 17 | '!<', |
||
| 18 | '!>', |
||
| 19 | 'LIKE', |
||
| 20 | 'IN', |
||
| 21 | ]; |
||
| 22 | |||
| 23 | private $_datos; |
||
| 24 | |||
| 25 | 43 | public function __construct(array $datos) |
|
| 26 | { |
||
| 27 | 43 | $this->_datos = $this->setDatos($datos); |
|
| 28 | 39 | } |
|
| 29 | |||
| 30 | 39 | public function datos(): array |
|
| 33 | } |
||
| 34 | |||
| 35 | 43 | public function setDatos($array): array |
|
| 43 | } |
||
| 44 | |||
| 45 | 42 | private function contieneValoresVacios($array): void |
|
| 46 | { |
||
| 47 | 42 | foreach ($array as $value) |
|
| 48 | { |
||
| 49 | 42 | if(empty($value)) |
|
| 50 | { |
||
| 51 | 1 | throw new Exception("Error Processing Request"); |
|
| 52 | } |
||
| 53 | } |
||
| 54 | 41 | } |
|
| 55 | |||
| 56 | 43 | private function numeroDeElementosValido($array): void |
|
| 61 | } |
||
| 62 | 42 | } |
|
| 63 | |||
| 64 | 40 | private function operadorValido($array): void |
|
| 65 | { |
||
| 66 | 40 | if(!in_array($array[1], $this->_operadoresValidos)) |
|
| 67 | { |
||
| 68 | 1 | throw new Exception("Error Processing Request"); |
|
| 69 | } |
||
| 70 | 39 | } |
|
| 71 | |||
| 72 | 41 | private function columnaEsString($array): void |
|
| 77 | } |
||
| 78 | } |
||
| 79 | } |