Completed
Pull Request — 1.3 (#47)
by
unknown
08:10 queued 03:49
created
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/Mouf/Database/MagicQuery.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/SQLParser/Node/Parameter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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 {
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
@@ -33,7 +33,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/SQLParser/Node/NodeFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.