Completed
Pull Request — 1.2 (#45)
by David
13:59
created
src/Mouf/Database/MagicQuery.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
             $sql = $this->getTwigEnvironment()->render($sql, $parameters);
86 86
         }
87 87
 
88
-        $availableParameterKeys = array_keys(array_filter($parameters, static function($param) { return $param !== null;}));
88
+        $availableParameterKeys = array_keys(array_filter($parameters, static function($param) { return $param !== null; }));
89 89
         // We choose md4 because it is fast.
90 90
         $cacheKey = 'request_build_'.hash('md4', $sql.'__'.implode('_/_', $availableParameterKeys));
91 91
         $newSql = $this->cache->fetch($cacheKey);
Please login to merge, or discard this patch.
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -168,7 +168,6 @@
 block discarded – undo
168 168
      * @param NodeInterface $sqlNode
169 169
      * @param array $parameters
170 170
      * @param bool $extrapolateParameters Whether the parameters should be fed into the returned SQL query
171
-
172 171
      * @return string
173 172
      */
174 173
     public function toSql(NodeInterface $sqlNode, array $parameters = array(), bool $extrapolateParameters = true)
Please login to merge, or discard this patch.
src/SQLParser/Node/Parameter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         if ($extrapolateParameters && isset($parameters[$this->name])) {
165 165
             if ($dbConnection) {
166 166
                 if (is_array($parameters[$this->name])) {
167
-                    return '('.implode(',', array_map(function ($item) use ($dbConnection) {
167
+                    return '('.implode(',', array_map(function($item) use ($dbConnection) {
168 168
                             return $dbConnection->quote($this->autoPrepend.$item.$this->autoAppend);
169 169
                         }, $parameters[$this->name])).')';
170 170
                 } else {
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
                     return 'null';
176 176
                 } else {
177 177
                     if (is_array($parameters[$this->name])) {
178
-                        return '('.implode(',', array_map(function ($item) {
178
+                        return '('.implode(',', array_map(function($item) {
179 179
                             return "'".addslashes($this->autoPrepend.$item.$this->autoAppend)."'";
180 180
                         }, $parameters[$this->name])).')';
181 181
                     } else {
Please login to merge, or discard this patch.