@@ -24,7 +24,6 @@ |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | - * @param string $caller |
|
| 28 | 27 | */ |
| 29 | 28 | public function isOk($parameters = null) |
| 30 | 29 | { |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | * |
| 59 | 59 | * @param Connection $dbConnection |
| 60 | 60 | * @param array $parameters |
| 61 | - * @param number $indent |
|
| 61 | + * @param integer $indent |
|
| 62 | 62 | * @param int $conditionsMode |
| 63 | 63 | * |
| 64 | 64 | * @return string |
@@ -635,6 +635,9 @@ discard block |
||
| 635 | 635 | }); |
| 636 | 636 | } |
| 637 | 637 | |
| 638 | + /** |
|
| 639 | + * @param \Closure $callback |
|
| 640 | + */ |
|
| 638 | 641 | private static function array_map_deep($array, $callback) |
| 639 | 642 | { |
| 640 | 643 | $new = array(); |
@@ -661,7 +664,7 @@ discard block |
||
| 661 | 664 | * @param array $parameters |
| 662 | 665 | * @param string $delimiter |
| 663 | 666 | * @param bool|string $wrapInBrackets |
| 664 | - * @param int|number $indent |
|
| 667 | + * @param integer $indent |
|
| 665 | 668 | * @param int $conditionsMode |
| 666 | 669 | * |
| 667 | 670 | * @return null|string |
@@ -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; |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | if (!empty($subTree) && !isset($subTree[0])) { |
| 435 | 435 | $subTree = StatementFactory::toObject($subTree); |
| 436 | 436 | } else { |
| 437 | - $subTree = array_map(function ($item) { |
|
| 437 | + $subTree = array_map(function($item) { |
|
| 438 | 438 | if (is_array($item)) { |
| 439 | 439 | return self::toObject($item); |
| 440 | 440 | } else { |
@@ -467,7 +467,7 @@ discard block |
||
| 467 | 467 | array('NOT'), |
| 468 | 468 | array('&&', 'AND'), |
| 469 | 469 | array('XOR'), |
| 470 | - array('||', 'OR'), ); |
|
| 470 | + array('||', 'OR'),); |
|
| 471 | 471 | |
| 472 | 472 | private static $OPERATOR_TO_CLASS = array( |
| 473 | 473 | '=' => 'SQLParser\Node\Equal', |
@@ -762,7 +762,7 @@ discard block |
||
| 762 | 762 | */ |
| 763 | 763 | public static function nodeToInstanceDescriptor($node, MoufManager $moufManager) |
| 764 | 764 | { |
| 765 | - return self::array_map_deep($node, function ($item) use ($moufManager) { |
|
| 765 | + return self::array_map_deep($node, function($item) use ($moufManager) { |
|
| 766 | 766 | if ($item instanceof NodeInterface) { |
| 767 | 767 | return $item->toInstanceDescriptor($moufManager); |
| 768 | 768 | } else { |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | { |
| 807 | 807 | if (is_array($nodes)) { |
| 808 | 808 | $elems = array(); |
| 809 | - array_walk_recursive($nodes, function ($item) use (&$elems, $dbConnection, $indent, $delimiter, $parameters, $conditionsMode) { |
|
| 809 | + array_walk_recursive($nodes, function($item) use (&$elems, $dbConnection, $indent, $delimiter, $parameters, $conditionsMode) { |
|
| 810 | 810 | if ($item instanceof SqlRenderInterface) { |
| 811 | 811 | $itemSql = $item->toSql($parameters, $dbConnection, $indent, $conditionsMode); |
| 812 | 812 | if ($itemSql !== null) { |
@@ -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); |
@@ -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 { |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | $rightOperand = $this->getRightOperand(); |
| 27 | 27 | if ($rightOperand instanceof Parameter) { |
| 28 | 28 | if (!isset($parameters[$rightOperand->getName()])) { |
| 29 | - throw new MagicQueryException("Missing parameter '" . $rightOperand->getName() . "' for 'IN' operand."); |
|
| 29 | + throw new MagicQueryException("Missing parameter '".$rightOperand->getName()."' for 'IN' operand."); |
|
| 30 | 30 | } |
| 31 | 31 | if ($parameters[$rightOperand->getName()] === []) { |
| 32 | 32 | return "FALSE"; |
@@ -24,7 +24,6 @@ |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | - * @param string $caller |
|
| 28 | 27 | */ |
| 29 | 28 | public function isOk($parameters = null) |
| 30 | 29 | { |
@@ -24,7 +24,6 @@ |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | - * @param string $caller |
|
| 28 | 27 | */ |
| 29 | 28 | public function isOk($parameters = null) |
| 30 | 29 | { |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | * |
| 59 | 59 | * @param Connection $dbConnection |
| 60 | 60 | * @param array $parameters |
| 61 | - * @param number $indent |
|
| 61 | + * @param integer $indent |
|
| 62 | 62 | * @param int $conditionsMode |
| 63 | 63 | * |
| 64 | 64 | * @return string |