@@ -48,7 +48,7 @@ |
||
| 48 | 48 | if (isset($desc['SELECT'])) { |
| 49 | 49 | $select = new Select(); |
| 50 | 50 | |
| 51 | - $columns = array_map(function ($item) { |
|
| 51 | + $columns = array_map(function($item) { |
|
| 52 | 52 | return NodeFactory::toObject($item); |
| 53 | 53 | }, $desc['SELECT']); |
| 54 | 54 | $columns = NodeFactory::simplify($columns); |
@@ -33,7 +33,6 @@ |
||
| 33 | 33 | namespace SQLParser\Node; |
| 34 | 34 | |
| 35 | 35 | use Mouf\Database\MagicQueryException; |
| 36 | -use Mouf\Database\MagicQueryParserException; |
|
| 37 | 36 | use SQLParser\SqlRenderInterface; |
| 38 | 37 | use Doctrine\DBAL\Connection; |
| 39 | 38 | use Mouf\MoufManager; |
@@ -511,7 +511,7 @@ discard block |
||
| 511 | 511 | array('NOT'), |
| 512 | 512 | array('&&', 'AND'), |
| 513 | 513 | array('XOR'), |
| 514 | - array('||', 'OR'), ); |
|
| 514 | + array('||', 'OR'),); |
|
| 515 | 515 | |
| 516 | 516 | private static $OPERATOR_TO_CLASS = array( |
| 517 | 517 | '=' => 'SQLParser\Node\Equal', |
@@ -818,7 +818,7 @@ discard block |
||
| 818 | 818 | */ |
| 819 | 819 | public static function nodeToInstanceDescriptor($node, MoufManager $moufManager) |
| 820 | 820 | { |
| 821 | - return self::array_map_deep($node, function ($item) use ($moufManager) { |
|
| 821 | + return self::array_map_deep($node, function($item) use ($moufManager) { |
|
| 822 | 822 | if ($item instanceof NodeInterface) { |
| 823 | 823 | return $item->toInstanceDescriptor($moufManager); |
| 824 | 824 | } else { |
@@ -862,7 +862,7 @@ discard block |
||
| 862 | 862 | { |
| 863 | 863 | if (is_array($nodes)) { |
| 864 | 864 | $elems = array(); |
| 865 | - array_walk_recursive($nodes, function ($item) use (&$elems, $dbConnection, $indent, $parameters, $conditionsMode, $extrapolateParameters) { |
|
| 865 | + array_walk_recursive($nodes, function($item) use (&$elems, $dbConnection, $indent, $parameters, $conditionsMode, $extrapolateParameters) { |
|
| 866 | 866 | if ($item instanceof SqlRenderInterface) { |
| 867 | 867 | $itemSql = $item->toSql($parameters, $dbConnection, $indent, $conditionsMode, $extrapolateParameters); |
| 868 | 868 | if ($itemSql !== null) { |
@@ -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); |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | |
| 34 | 34 | /** @var Twig_Extension_Core $twigExtensionCore */ |
| 35 | 35 | $twigExtensionCore = $twig->getExtension('Twig_Extension_Core'); |
| 36 | - $twigExtensionCore->setEscaper('sql', function () { |
|
| 36 | + $twigExtensionCore->setEscaper('sql', function() { |
|
| 37 | 37 | throw new ForbiddenTwigParameterInSqlException('You cannot use Twig expressions (like "{{ id }}"). Instead, you should use SQL parameters (like ":id"). Twig integration is limited to Twig statements (like "{% for .... %}"'); |
| 38 | 38 | }); |
| 39 | 39 | |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | |
| 34 | 34 | if ($parameterNode !== null) { |
| 35 | 35 | if (!isset($parameters[$parameterNode->getName()])) { |
| 36 | - throw new MagicQueryException("Missing parameter '" . $parameterNode->getName() . "' for 'IN' operand."); |
|
| 36 | + throw new MagicQueryException("Missing parameter '".$parameterNode->getName()."' for 'IN' operand."); |
|
| 37 | 37 | } |
| 38 | 38 | if ($parameters[$parameterNode->getName()] === []) { |
| 39 | 39 | return "FALSE"; |
@@ -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 { |