Passed
Push — main ( 54e4df...1e4bb3 )
by Osvaldo
01:40
created
src/pdodatabase/elementos/ValidadorDeParametrosWhereBetween.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     {
33 33
         foreach ($array as $value)
34 34
         {
35
-            if(empty($value))
35
+            if (empty($value))
36 36
             {
37 37
                 throw new Exception("Error Processing Request");
38 38
             }
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
     private function valoresNoSonIguales($array): void
43 43
     {
44
-        if($array[1] == $array[2])
44
+        if ($array[1] == $array[2])
45 45
         {
46 46
             throw new Exception("Error Processing Request");
47 47
         }
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     private function numeroDeElementosValido($array): void
51 51
     {
52
-        if(count($array) !== 3)
52
+        if (count($array) !== 3)
53 53
         {
54 54
             throw new Exception("Error Processing Request");
55 55
         }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
     private function columnaEsString($array): void
59 59
     {
60
-        if(!is_string($array[0]))
60
+        if (!is_string($array[0]))
61 61
         {
62 62
             throw new Exception("Error Processing Request");
63 63
         }
Please login to merge, or discard this patch.
src/pdodatabase/elementos/Tabla.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 
20 20
     private function setTabla(string $tabla): string
21 21
     {
22
-        if(empty($tabla))
22
+        if (empty($tabla))
23 23
         {
24 24
             throw new Exception("Error Processing Request");
25 25
         }
Please login to merge, or discard this patch.
src/pdodatabase/elementos/ValidadorDeParametrosWhereAndOthers.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     {
48 48
         foreach ($array as $value)
49 49
         {
50
-            if(empty($value))
50
+            if (empty($value))
51 51
             {
52 52
                 throw new Exception("Error Processing Request");
53 53
             }
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
     private function columnasSonString($array): void
58 58
     {
59
-        if(!is_string($array[0]) || !is_string($array[3]))
59
+        if (!is_string($array[0]) || !is_string($array[3]))
60 60
         {
61 61
             throw new Exception("Error Processing Request");
62 62
         }
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
     private function numeroDeElementosValido($array): void
66 66
     {
67
-        if(count($array) !== 6)
67
+        if (count($array) !== 6)
68 68
         {
69 69
             throw new Exception("Error Processing Request");
70 70
         }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
     private function operadorValido($array): void
74 74
     {
75
-        if(!in_array($array[1], $this->_operadoresValidos) || !in_array($array[4], $this->_operadoresValidos))
75
+        if (!in_array($array[1], $this->_operadoresValidos) || !in_array($array[4], $this->_operadoresValidos))
76 76
         {
77 77
             throw new Exception("Error Processing Request");
78 78
         }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
     private function columnasRepetidas($array): void
82 82
     {
83
-        if($array[0] == $array[3])
83
+        if ($array[0] == $array[3])
84 84
         {
85 85
             throw new Exception("Error Processing Request");
86 86
         }
Please login to merge, or discard this patch.
src/pdodatabase/elementos/WhereAnd.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,6 +20,6 @@
 block discarded – undo
20 20
 
21 21
     public function datos(): array
22 22
     {
23
-        return [ $this->_where[2], $this->_where[5] ];
23
+        return [$this->_where[2], $this->_where[5]];
24 24
     }
25 25
 }
26 26
\ No newline at end of file
Please login to merge, or discard this patch.
src/pdodatabase/elementos/WhereOr.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,6 +20,6 @@
 block discarded – undo
20 20
 
21 21
     public function datos(): array
22 22
     {
23
-        return [ $this->_where[2], $this->_where[5] ];
23
+        return [$this->_where[2], $this->_where[5]];
24 24
     }
25 25
 }
26 26
\ No newline at end of file
Please login to merge, or discard this patch.
test/ElementosTest.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 
47 47
     public function testCamposSoloRetornaTexto()
48 48
     {
49
-        $campos = new Campos(['*','78']);
49
+        $campos = new Campos(['*', '78']);
50 50
         $this->assertIsString($campos->sql());
51 51
     }
52 52
 
@@ -57,9 +57,9 @@  discard block
 block discarded – undo
57 57
         $tabla = new Tabla('prueba');
58 58
         $campos = new Campos(['a,b,c,d']);
59 59
 
60
-        $camposytabla = new CamposYTabla($campos,$tabla);
60
+        $camposytabla = new CamposYTabla($campos, $tabla);
61 61
 
62
-        $this->assertSame('a,b,c,d FROM prueba',$camposytabla->sql());
62
+        $this->assertSame('a,b,c,d FROM prueba', $camposytabla->sql());
63 63
     }
64 64
 
65 65
     //Clase ValidadorDeParametrosWhere
@@ -73,13 +73,13 @@  discard block
 block discarded – undo
73 73
     public function testValidadorDeParametrosWhereLaColumnaSoloPuedeSerString()
74 74
     {
75 75
         $this->expectException(Exception::class);
76
-        new ValidadorDeParametrosWhere([1,'1','2']);
76
+        new ValidadorDeParametrosWhere([1, '1', '2']);
77 77
     }
78 78
 
79 79
     public function testValidadorDeParametrosWhereNingunCampoPuedeEstarVacio()
80 80
     {
81 81
         $this->expectException(Exception::class);
82
-        new ValidadorDeParametrosWhere(['','1','2']);
82
+        new ValidadorDeParametrosWhere(['', '1', '2']);
83 83
     }
84 84
 
85 85
     //Clase ValidadorDeParametrosWhereBetween
@@ -93,19 +93,19 @@  discard block
 block discarded – undo
93 93
     public function testValidadorDeParametrosWhereBetweenNoPuedeTenerValoresIguales()
94 94
     {
95 95
         $this->expectException(Exception::class);
96
-        new ValidadorDeParametrosWhereBetween(['id','1','1']);
96
+        new ValidadorDeParametrosWhereBetween(['id', '1', '1']);
97 97
     }
98 98
 
99 99
     public function testValidadorDeParametrosWhereBetweenLaColumnaSoloPuedeSerString()
100 100
     {
101 101
         $this->expectException(Exception::class);
102
-        new ValidadorDeParametrosWhereBetween([1,'1','2']);
102
+        new ValidadorDeParametrosWhereBetween([1, '1', '2']);
103 103
     }
104 104
 
105 105
     public function testValidadorDeParametrosWhereBetweenNingunCampoPuedeEstarVacio()
106 106
     {
107 107
         $this->expectException(Exception::class);
108
-        new ValidadorDeParametrosWhereBetween(['','1','2']);
108
+        new ValidadorDeParametrosWhereBetween(['', '1', '2']);
109 109
     }
110 110
 
111 111
     //Clase Where
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     {
115 115
         $where = new Where(
116 116
             new ValidadorDeParametrosWhere(
117
-                ['id','=','21']
117
+                ['id', '=', '21']
118 118
             )
119 119
             );
120 120
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     {
126 126
         $where = new Where(
127 127
             new ValidadorDeParametrosWhere(
128
-                ['id','=','21']
128
+                ['id', '=', '21']
129 129
             )
130 130
             );
131 131
 
@@ -143,19 +143,19 @@  discard block
 block discarded – undo
143 143
     public function testValidadorDeParametrosWhereAndOthersNoPuedeTenerValoresIguales()
144 144
     {
145 145
         $this->expectException(Exception::class);
146
-        new ValidadorDeParametrosWhereAndOthers(['id','=','1','id','=','1']);
146
+        new ValidadorDeParametrosWhereAndOthers(['id', '=', '1', 'id', '=', '1']);
147 147
     }
148 148
 
149 149
     public function testValidadorDeParametrosWhereAndOthersLaColumnaSoloPuedeSerString()
150 150
     {
151 151
         $this->expectException(Exception::class);
152
-        new ValidadorDeParametrosWhereAndOthers([1,'=','2','1','=','2']);
152
+        new ValidadorDeParametrosWhereAndOthers([1, '=', '2', '1', '=', '2']);
153 153
     }
154 154
 
155 155
     public function testValidadorDeParametrosWhereAndOthersNingunCampoPuedeEstarVacio()
156 156
     {
157 157
         $this->expectException(Exception::class);
158
-        new ValidadorDeParametrosWhereAndOthers(['','1','2','','','']);
158
+        new ValidadorDeParametrosWhereAndOthers(['', '1', '2', '', '', '']);
159 159
     }
160 160
 
161 161
     //Clase Where And
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
     {
165 165
         $where = new WhereAnd(
166 166
             new ValidadorDeParametrosWhereAndOthers(
167
-                ['id','=','21','uno','=','1']
167
+                ['id', '=', '21', 'uno', '=', '1']
168 168
             )
169 169
             );
170 170
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
     {
178 178
         $where = new WhereOr(
179 179
             new ValidadorDeParametrosWhereAndOthers(
180
-                ['id','=','21','uno','=','1']
180
+                ['id', '=', '21', 'uno', '=', '1']
181 181
             )
182 182
             );
183 183
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
     {
191 191
         $where = new WhereBetween(
192 192
             new ValidadorDeParametrosWhereBetween(
193
-                ['id','1','21']
193
+                ['id', '1', '21']
194 194
             )
195 195
             );
196 196
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
     {
204 204
         $where = new WhereNotBetween(
205 205
             new ValidadorDeParametrosWhereBetween(
206
-                ['id','1','21']
206
+                ['id', '1', '21']
207 207
             )
208 208
             );
209 209
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
     {
217 217
         $where = new WhereNotBetween(
218 218
             new ValidadorDeParametrosWhereBetween(
219
-                ['id','1','21']
219
+                ['id', '1', '21']
220 220
             )
221 221
             );
222 222
         
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
     {
234 234
         $where = new WhereNotBetween(
235 235
             new ValidadorDeParametrosWhereBetween(
236
-                ['id','1','21']
236
+                ['id', '1', '21']
237 237
             )
238 238
             );
239 239
         
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
             new CamposYTabla(
246 246
                 new Campos(['*']),
247 247
                 new Tabla('prueba')
248
-            ),$como
248
+            ), $como
249 249
         );
250 250
 
251 251
         $this->assertSame('SELECT * FROM prueba WHERE NOT BETWEEN id ? AND ?', $sentencia->sql());
Please login to merge, or discard this patch.
Index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 declare(strict_types=1);
3 3
 
4
-require_once __DIR__ . '/vendor/autoload.php';
4
+require_once __DIR__.'/vendor/autoload.php';
5 5
 
6 6
 use src\Factory;
7 7
 use src\pdodatabase\resultados\ContarResultados;
@@ -15,10 +15,10 @@  discard block
 block discarded – undo
15 15
 
16 16
 // SELECT * FROM prueba
17 17
 
18
-$select = $factory->crear('src\factory\SelectWhere',[
18
+$select = $factory->crear('src\factory\SelectWhere', [
19 19
     'tabla' => 'prueba',
20 20
     'campos' => ['*'],
21
-    'where' => ['id','=','42']
21
+    'where' => ['id', '=', '42']
22 22
 ]);
23 23
 
24 24
 $select = $select->obtener();
Please login to merge, or discard this patch.