Passed
Pull Request — master (#1)
by
unknown
01:21
created
Source/Root/Connection.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      */
33 33
     public function PDO()
34 34
     {
35
-        if(empty($this->conn)) {
35
+        if (empty($this->conn)) {
36 36
             try {
37 37
                 $this->conn = new PDO(
38 38
                     $this->config['driver'] . ":host=" .
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
                     $this->config['password'],
45 45
                     $this->config['options']
46 46
                 );
47
-            } catch(PDOException $exception) {
47
+            } catch (PDOException $exception) {
48 48
                 echo json_encode(
49 49
                     ['error' => 
50 50
                         [
Please login to merge, or discard this patch.
Source/Model/CRUD.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -11,28 +11,28 @@
 block discarded – undo
11 11
         $params = explode(', ', $params);
12 12
         $data = [];
13 13
         $paramsCount = count($params); $dataCount = count($data);
14
-            for($i = 0; $i < $paramsCount; $i++) {
15
-                $data[$i] = ":".$params[$i][0].$params[$i][1].$params[$i][2].", ";
14
+            for ($i = 0; $i < $paramsCount; $i++) {
15
+                $data[$i] = ":" . $params[$i][0] . $params[$i][1] . $params[$i][2] . ", ";
16 16
             }
17 17
         $result = '';
18 18
         $final = array_map(null, $params, $data);
19
-            foreach($final as $key => $vals) {
20
-                foreach($vals as $chave => $val) {
19
+            foreach ($final as $key => $vals) {
20
+                foreach ($vals as $chave => $val) {
21 21
                     $result .= str_replace(':', ' = :', $val);
22 22
                 }
23 23
             }
24 24
         $result = rtrim($result, ', ');
25
-        $sql = $this->conn->prepare("UPDATE $table SET $result ". (isset($where) ? "WHERE ". $where : ''));
26
-            for($i = 0; $i < $paramsCount; $i++) {
27
-                $data[$i] = ":".$params[$i][0].$params[$i][1].$params[$i][2];
25
+        $sql = $this->conn->prepare("UPDATE $table SET $result " . (isset($where) ? "WHERE " . $where : ''));
26
+            for ($i = 0; $i < $paramsCount; $i++) {
27
+                $data[$i] = ":" . $params[$i][0] . $params[$i][1] . $params[$i][2];
28 28
             }
29
-            for($i = 0; $i < $dataCount; $i++) {
29
+            for ($i = 0; $i < $dataCount; $i++) {
30 30
                 $sql->bindParam($data[$i], $values[$i]);
31 31
             }
32
-        if($sql->execute()) {
32
+        if ($sql->execute()) {
33 33
             return true;
34 34
         } else {
35
-            echo "Erro:". $sql->errorInfo();
35
+            echo "Erro:" . $sql->errorInfo();
36 36
         }
37 37
     }
38 38
 }
39 39
\ No newline at end of file
Please login to merge, or discard this patch.