@@ -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); |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | $assignment = $this->process_expr_list($this->splitSQLIntoTokens($base_expr)); |
| 572 | 572 | |
| 573 | 573 | return array('expr_type' => ExpressionType::EXPRESSION, 'base_expr' => trim($base_expr), |
| 574 | - 'sub_tree' => $assignment, ); |
|
| 574 | + 'sub_tree' => $assignment,); |
|
| 575 | 575 | } |
| 576 | 576 | |
| 577 | 577 | private function getVariableType($expression) |
@@ -843,7 +843,7 @@ discard block |
||
| 843 | 843 | || $this->isFunction($prev) || $this->isExpression($prev) || $this->isSubQuery($prev) |
| 844 | 844 | || $this->isColumnReference($prev) || $this->isBracketExpression($prev)) { |
| 845 | 845 | $alias = array('as' => false, 'name' => trim($last['base_expr']), |
| 846 | - 'base_expr' => trim($last['base_expr']), ); |
|
| 846 | + 'base_expr' => trim($last['base_expr']),); |
|
| 847 | 847 | #remove the last token |
| 848 | 848 | array_pop($tokens); |
| 849 | 849 | $base_expr = implode('', $tokens); |
@@ -873,7 +873,7 @@ discard block |
||
| 873 | 873 | } |
| 874 | 874 | |
| 875 | 875 | return array('expr_type' => $type, 'alias' => $alias, 'base_expr' => trim($base_expr), |
| 876 | - 'sub_tree' => $processed, ); |
|
| 876 | + 'sub_tree' => $processed,); |
|
| 877 | 877 | } |
| 878 | 878 | |
| 879 | 879 | /** |
@@ -1015,7 +1015,7 @@ discard block |
||
| 1015 | 1015 | return array('expression' => '', 'token_count' => 0, 'table' => '', 'alias' => false, 'join_type' => '', |
| 1016 | 1016 | 'next_join_type' => '', 'saved_join_type' => $parseInfo['saved_join_type'], |
| 1017 | 1017 | 'ref_type' => false, 'ref_expr' => false, 'base_expr' => false, 'sub_tree' => false, |
| 1018 | - 'subquery' => '', ); |
|
| 1018 | + 'subquery' => '',); |
|
| 1019 | 1019 | } |
| 1020 | 1020 | |
| 1021 | 1021 | private function processFromExpression(&$parseInfo) |
@@ -1099,7 +1099,7 @@ discard block |
||
| 1099 | 1099 | } |
| 1100 | 1100 | |
| 1101 | 1101 | return array('expr_type' => $parseInfo['type'], 'base_expr' => $parseInfo['expr'], |
| 1102 | - 'direction' => $parseInfo['dir'], ); |
|
| 1102 | + 'direction' => $parseInfo['dir'],); |
|
| 1103 | 1103 | } |
| 1104 | 1104 | |
| 1105 | 1105 | private function initParseInfoForOrder() |
@@ -1559,7 +1559,7 @@ discard block |
||
| 1559 | 1559 | unset($values[$k]); |
| 1560 | 1560 | } else { |
| 1561 | 1561 | $values[$k] = array('expr_type' => ExpressionType::RECORD, 'base_expr' => $v, |
| 1562 | - 'data' => $this->process_record($v), ); |
|
| 1562 | + 'data' => $this->process_record($v),); |
|
| 1563 | 1563 | } |
| 1564 | 1564 | } |
| 1565 | 1565 | |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | if (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 { |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | |
| 28 | 28 | // Default escaper will throw an exception. This is because we want to use SQL parameters instead of Twig. |
| 29 | 29 | // This ahs a number of advantages, especially in terms of caching. |
| 30 | - $twig->getExtension('core')->setEscaper('sql', function () { |
|
| 30 | + $twig->getExtension('core')->setEscaper('sql', function() { |
|
| 31 | 31 | 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 .... %}"'); |
| 32 | 32 | }); |
| 33 | 33 | |