Passed
Pull Request — master (#84)
by Šimon
02:36
created
src/Query/Degeneration/Bindings.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -64,10 +64,10 @@  discard block
 block discarded – undo
64 64
      * @param string $pattern
65 65
      * @return string
66 66
      */
67
-    public function compile_binds($sql, $binds,$pattern)
67
+    public function compile_binds($sql, $binds, $pattern)
68 68
     {
69 69
         return preg_replace_callback($pattern, function($m) use ($binds){
70
-            if(isset($binds[$m[1]])){ // If it exists in our array
70
+            if (isset($binds[$m[1]])) { // If it exists in our array
71 71
                 return $binds[$m[1]]; // Then replace it from our array
72 72
             }
73 73
 
@@ -83,14 +83,14 @@  discard block
 block discarded – undo
83 83
      */
84 84
     public function process($sql)
85 85
     {
86
-        $bindFormatted=[];
87
-        $bindRaw=[];
86
+        $bindFormatted = [];
87
+        $bindRaw = [];
88 88
         foreach ($this->bindings as $key => $value) {
89 89
             if (is_array($value)) {
90 90
                 $valueSet = implode(', ', $value);
91 91
 
92 92
                 $values = array_map(
93
-                    function ($value) {
93
+                    function($value) {
94 94
                         return $this->formatParameter($value);
95 95
                     },
96 96
                     $value
@@ -103,21 +103,21 @@  discard block
 block discarded – undo
103 103
             }
104 104
 
105 105
             if ($formattedParameter !== null) {
106
-                $bindFormatted[$key]=$formattedParameter;
106
+                $bindFormatted[$key] = $formattedParameter;
107 107
             }
108 108
 
109 109
             if ($valueSet !== null) {
110
-                $bindRaw[$key]=$valueSet;
110
+                $bindRaw[$key] = $valueSet;
111 111
             }
112 112
         }
113 113
 
114
-        for ($loop=0;$loop<2;$loop++)
114
+        for ($loop = 0; $loop < 2; $loop++)
115 115
         {
116 116
             // dipping in binds
117 117
             // example ['A' => '{B}' , 'B'=>':C','C'=>123]
118
-            $sql=$this->compile_binds($sql,$bindRaw,'#{([\w+]+)}#');
118
+            $sql = $this->compile_binds($sql, $bindRaw, '#{([\w+]+)}#');
119 119
         }
120
-        $sql=$this->compile_binds($sql,$bindFormatted,'#:([\w+]+)#');
120
+        $sql = $this->compile_binds($sql, $bindFormatted, '#:([\w+]+)#');
121 121
 
122 122
         return $sql;
123 123
     }
Please login to merge, or discard this patch.