@@ -35,7 +35,7 @@ |
||
| 35 | 35 | |
| 36 | 36 | private function setCampos(string $campos): string |
| 37 | 37 | { |
| 38 | - $campos = str_replace(',',','.$this->_tabla->sql().'.',$campos); |
|
| 38 | + $campos = str_replace(',', ','.$this->_tabla->sql().'.', $campos); |
|
| 39 | 39 | |
| 40 | 40 | return $this->_tabla->sql().'.'.$campos; |
| 41 | 41 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | private function estaVacio(string $string): void |
| 36 | 36 | { |
| 37 | - if(empty($string)) |
|
| 37 | + if (empty($string)) |
|
| 38 | 38 | { |
| 39 | 39 | throw new Exception("Error Processing Request"); |
| 40 | 40 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | private function esValido(string $string): void |
| 44 | 44 | { |
| 45 | - if(!array_key_exists($string, $this->_tiposValidos)) |
|
| 45 | + if (!array_key_exists($string, $this->_tiposValidos)) |
|
| 46 | 46 | { |
| 47 | 47 | throw new Exception("Error Processing Request"); |
| 48 | 48 | } |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | public function __construct(Tabla $Tabla, Campos $Campos, array $Joins) |
| 14 | 14 | { |
| 15 | - $this->_joins = array_reverse( (array) $Joins); |
|
| 15 | + $this->_joins = array_reverse((array) $Joins); |
|
| 16 | 16 | $this->_tabla = $Tabla; |
| 17 | 17 | $this->_campos = $this->setCampos($Campos->sql()); |
| 18 | 18 | |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | $sql = $join->sql().' '.$sql; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - return 'SELECT '.$this->_campos.','.$this->campos(). ' FROM '. $this->_tabla->sql().' '.$sql; |
|
| 30 | + return 'SELECT '.$this->_campos.','.$this->campos().' FROM '.$this->_tabla->sql().' '.$sql; |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | private function campos(): string |
@@ -39,12 +39,12 @@ discard block |
||
| 39 | 39 | $campos = $campos.$join->campos().','; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - return trim($campos,','); |
|
| 42 | + return trim($campos, ','); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | private function setCampos(string $campos): string |
| 46 | 46 | { |
| 47 | - $campos = str_replace(',',','.$this->_tabla->sql().'.',$campos); |
|
| 47 | + $campos = str_replace(',', ','.$this->_tabla->sql().'.', $campos); |
|
| 48 | 48 | |
| 49 | 49 | return $this->_tabla->sql().'.'.$campos; |
| 50 | 50 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $this->elStringEstaVacio($array); |
| 30 | 30 | $this->tieneMasValores($array); |
| 31 | 31 | |
| 32 | - if(count($array) == 1) |
|
| 32 | + if (count($array) == 1) |
|
| 33 | 33 | { |
| 34 | 34 | $this->_tabla1 = $array[0]; |
| 35 | 35 | $this->_tabla2 = $array[0]; |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | private function estaVacioElArray(array $array): void |
| 45 | 45 | { |
| 46 | - if(count($array) == 0) |
|
| 46 | + if (count($array) == 0) |
|
| 47 | 47 | { |
| 48 | 48 | throw new Exception("Error Processing Request"); |
| 49 | 49 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | private function tieneMasValores(array $array): void |
| 54 | 54 | { |
| 55 | - if(count($array) > 2) |
|
| 55 | + if (count($array) > 2) |
|
| 56 | 56 | { |
| 57 | 57 | throw new Exception("Error Processing Request"); |
| 58 | 58 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | { |
| 64 | 64 | foreach ($array as $value) |
| 65 | 65 | { |
| 66 | - if(empty($value)) |
|
| 66 | + if (empty($value)) |
|
| 67 | 67 | { |
| 68 | 68 | throw new Exception("Error Processing Request"); |
| 69 | 69 | |
@@ -33,8 +33,7 @@ |
||
| 33 | 33 | { |
| 34 | 34 | $this->_tabla1 = $array[0]; |
| 35 | 35 | $this->_tabla2 = $array[0]; |
| 36 | - } |
|
| 37 | - else |
|
| 36 | + } else |
|
| 38 | 37 | { |
| 39 | 38 | $this->_tabla1 = $array[0]; |
| 40 | 39 | $this->_tabla2 = $array[1]; |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | declare(strict_types=1); |
| 3 | -require_once __DIR__ . '/vendor/autoload.php'; |
|
| 3 | +require_once __DIR__.'/vendor/autoload.php'; |
|
| 4 | 4 | |
| 5 | 5 | use src\Factory; |
| 6 | 6 | use src\pdodatabase\elementos\Campos; |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | new Tabla('TABLA1'), |
| 64 | 64 | new Tabla('tabla2'), |
| 65 | 65 | new Campos(['id', 'dos AS DOS']), |
| 66 | - new NombreColumnaJoin(['id1','id2']) |
|
| 66 | + new NombreColumnaJoin(['id1', 'id2']) |
|
| 67 | 67 | ) |
| 68 | 68 | ] |
| 69 | 69 | ); |