@@ -85,7 +85,7 @@ |
||
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); |
@@ -168,7 +168,6 @@ |
||
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) |
@@ -164,7 +164,7 @@ discard block |
||
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 |
||
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 { |