Completed
Pull Request — 1.2 (#45)
by David
13:59
created
src/SQLParser/Node/AbstractManyInstancesOperator.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/SQLParser/Node/NodeFactory.php 3 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -635,6 +635,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,6 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
             if (!empty($subTree) && !isset($subTree[0])) {
453 453
                 $subTree = StatementFactory::toObject($subTree);
454 454
             } else {
455
-                $subTree = array_map(function ($item) {
455
+                $subTree = array_map(function($item) {
456 456
                     if (is_array($item)) {
457 457
                         return self::toObject($item);
458 458
                     } else {
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
             array('NOT'),
486 486
             array('&&', 'AND'),
487 487
             array('XOR'),
488
-            array('||', 'OR'), );
488
+            array('||', 'OR'),);
489 489
 
490 490
     private static $OPERATOR_TO_CLASS = array(
491 491
             '=' => 'SQLParser\Node\Equal',
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
      */
793 793
     public static function nodeToInstanceDescriptor($node, MoufManager $moufManager)
794 794
     {
795
-        return self::array_map_deep($node, function ($item) use ($moufManager) {
795
+        return self::array_map_deep($node, function($item) use ($moufManager) {
796 796
             if ($item instanceof NodeInterface) {
797 797
                 return $item->toInstanceDescriptor($moufManager);
798 798
             } else {
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
     {
837 837
         if (is_array($nodes)) {
838 838
             $elems = array();
839
-            array_walk_recursive($nodes, function ($item) use (&$elems, $dbConnection, $indent, $parameters, $conditionsMode, $extrapolateParameters) {
839
+            array_walk_recursive($nodes, function($item) use (&$elems, $dbConnection, $indent, $parameters, $conditionsMode, $extrapolateParameters) {
840 840
                 if ($item instanceof SqlRenderInterface) {
841 841
                     $itemSql = $item->toSql($parameters, $dbConnection, $indent, $conditionsMode, $extrapolateParameters);
842 842
                     if ($itemSql !== null) {
Please login to merge, or discard this patch.
src/SQLParser/Query/StatementFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/SQLParser/Node/In.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
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";
Please login to merge, or discard this patch.
src/SQLParser/Node/SimpleFunction.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/SQLParser/Node/SubQuery.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/SQLParser/Node/WhenConditions.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/SQLParser/Query/Select.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -316,7 +316,7 @@
 block discarded – undo
316 316
      *
317 317
      * @param array      $parameters
318 318
      * @param Connection $dbConnection
319
-     * @param int|number $indent
319
+     * @param integer $indent
320 320
      * @param int        $conditionsMode
321 321
      *
322 322
      * @return string
Please login to merge, or discard this patch.
src/Mouf/Database/MagicQuery/Twig/SqlTwigEnvironmentFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 
29 29
         // Default escaper will throw an exception. This is because we want to use SQL parameters instead of Twig.
30 30
         // This has a number of advantages, especially in terms of caching.
31
-        $twig->getExtension('Twig_Extension_Core')->setEscaper('sql', function () {
31
+        $twig->getExtension('Twig_Extension_Core')->setEscaper('sql', function() {
32 32
             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 .... %}"');
33 33
         });
34 34
 
Please login to merge, or discard this patch.