@@ -19,10 +19,10 @@ discard block |
||
| 19 | 19 | { |
| 20 | 20 | $query = $this->_conexion->prepare($sentencia->sql()); |
| 21 | 21 | |
| 22 | - $x=1; |
|
| 22 | + $x = 1; |
|
| 23 | 23 | foreach ($sentencia->datos() as $value) |
| 24 | 24 | { |
| 25 | - $query->bindValue($x,$value); |
|
| 25 | + $query->bindValue($x, $value); |
|
| 26 | 26 | $x++; |
| 27 | 27 | } |
| 28 | 28 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | $query->execute(); |
| 32 | 32 | } |
| 33 | - catch(PDOException $e) |
|
| 33 | + catch (PDOException $e) |
|
| 34 | 34 | { |
| 35 | 35 | throw new Exception("Error en la consulta"); |
| 36 | 36 | } |
@@ -29,8 +29,7 @@ |
||
| 29 | 29 | try |
| 30 | 30 | { |
| 31 | 31 | $query->execute(); |
| 32 | - } |
|
| 33 | - catch(PDOException $e) |
|
| 32 | + } catch(PDOException $e) |
|
| 34 | 33 | { |
| 35 | 34 | throw new Exception("Error en la consulta"); |
| 36 | 35 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | { |
| 24 | 24 | $query->execute(); |
| 25 | 25 | } |
| 26 | - catch(PDOException $e) |
|
| 26 | + catch (PDOException $e) |
|
| 27 | 27 | { |
| 28 | 28 | throw new Exception("Error en la consulta"); |
| 29 | 29 | } |
@@ -22,8 +22,7 @@ |
||
| 22 | 22 | try |
| 23 | 23 | { |
| 24 | 24 | $query->execute(); |
| 25 | - } |
|
| 26 | - catch(PDOException $e) |
|
| 25 | + } catch(PDOException $e) |
|
| 27 | 26 | { |
| 28 | 27 | throw new Exception("Error en la consulta"); |
| 29 | 28 | } |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | new Como( |
| 62 | 62 | new Where( |
| 63 | 63 | new ValidadorDeParametrosWhere( |
| 64 | - ['id','=',12] |
|
| 64 | + ['id', '=', 12] |
|
| 65 | 65 | ) |
| 66 | 66 | ) |
| 67 | 67 | ) |
@@ -26,34 +26,34 @@ |
||
| 26 | 26 | public function testFactorySelectWhereDevuelveClaseAdecuada() |
| 27 | 27 | { |
| 28 | 28 | $select = new SelectWhere; |
| 29 | - $this->assertInstanceOf(ConsultaSelectWhere::class, $select->crear(['tabla' => 'prueba', 'campos' => ['*'],'where' => ['id','=',2]])); |
|
| 29 | + $this->assertInstanceOf(ConsultaSelectWhere::class, $select->crear(['tabla' => 'prueba', 'campos' => ['*'], 'where' => ['id', '=', 2]])); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | // SelectWhereAnd |
| 33 | 33 | public function testFactorySelectWhereAndDevuelveClaseAdecuada() |
| 34 | 34 | { |
| 35 | 35 | $select = new SelectWhereAnd; |
| 36 | - $this->assertInstanceOf(ConsultaSelectWhere::class, $select->crear(['tabla' => 'prueba', 'campos' => ['*'],'where' => ['id','=',2,'uno','=',9]])); |
|
| 36 | + $this->assertInstanceOf(ConsultaSelectWhere::class, $select->crear(['tabla' => 'prueba', 'campos' => ['*'], 'where' => ['id', '=', 2, 'uno', '=', 9]])); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | // SelectWhereOr |
| 40 | 40 | public function testFactorySelectWhereOrDevuelveClaseAdecuada() |
| 41 | 41 | { |
| 42 | 42 | $select = new SelectWhereOr; |
| 43 | - $this->assertInstanceOf(ConsultaSelectWhere::class, $select->crear(['tabla' => 'prueba', 'campos' => ['*'],'where' => ['id','=',2,'uno','=',9]])); |
|
| 43 | + $this->assertInstanceOf(ConsultaSelectWhere::class, $select->crear(['tabla' => 'prueba', 'campos' => ['*'], 'where' => ['id', '=', 2, 'uno', '=', 9]])); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | // SelectWhereBetween |
| 47 | 47 | public function testFactorySelectWhereBetweenDevuelveClaseAdecuada() |
| 48 | 48 | { |
| 49 | 49 | $select = new SelectWhereBetween; |
| 50 | - $this->assertInstanceOf(ConsultaSelectWhere::class, $select->crear(['tabla' => 'prueba', 'campos' => ['*'],'where' => ['id','1',2]])); |
|
| 50 | + $this->assertInstanceOf(ConsultaSelectWhere::class, $select->crear(['tabla' => 'prueba', 'campos' => ['*'], 'where' => ['id', '1', 2]])); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // SelectWhereBetween |
| 54 | 54 | public function testFactorySelectWhereNotBetweenDevuelveClaseAdecuada() |
| 55 | 55 | { |
| 56 | 56 | $select = new SelectWhereNotBetween; |
| 57 | - $this->assertInstanceOf(ConsultaSelectWhere::class, $select->crear(['tabla' => 'prueba', 'campos' => ['*'],'where' => ['id','1',2]])); |
|
| 57 | + $this->assertInstanceOf(ConsultaSelectWhere::class, $select->crear(['tabla' => 'prueba', 'campos' => ['*'], 'where' => ['id', '1', 2]])); |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | \ No newline at end of file |