Completed
Pull Request — 1.5 (#82)
by
unknown
38s
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/Mouf/Database/MagicQuery.php 2 patches
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -168,7 +168,6 @@
 block discarded – undo
168 168
      * @param NodeInterface $sqlNode
169 169
      * @param array $parameters
170 170
      * @param bool $extrapolateParameters Whether the parameters should be fed into the returned SQL query
171
-
172 171
      * @return string
173 172
      */
174 173
     public function toSql(NodeInterface $sqlNode, array $parameters = array(), bool $extrapolateParameters = true)
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@
 block discarded – undo
137 137
             $sql = $this->getTwigEnvironment()->render($sql, $parameters);
138 138
         }
139 139
 
140
-        $availableParameterKeys = array_keys(array_filter($parameters, static function($param) { return $param !== null && $param !== [];}));
140
+        $availableParameterKeys = array_keys(array_filter($parameters, static function($param) { return $param !== null && $param !== []; }));
141 141
         // We choose md4 because it is fast.
142 142
         $cacheKey = 'request_build_'.hash('md4', get_class($this->platform).'__'.$sql.'__'.implode('_/_', $availableParameterKeys));
143 143
         $newSql = $this->cache->fetch($cacheKey);
Please login to merge, or discard this patch.
src/SQLParser/Node/Parameter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -166,7 +166,7 @@
 block discarded – undo
166 166
             if ($parameters[$this->name] === null) {
167 167
                 return 'null';
168 168
             } elseif (is_array($parameters[$this->name])) {
169
-                return implode(',', array_map(function ($item) use ($platform) {
169
+                return implode(',', array_map(function($item) use ($platform) {
170 170
                         return $platform->quoteStringLiteral($this->autoPrepend.$item.$this->autoAppend);
171 171
                     }, $parameters[$this->name]));
172 172
             } 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
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 
37 37
         /** @var EscaperExtension $twigExtensionEscaper */
38 38
         $twigExtensionEscaper = $twig->getExtension(EscaperExtension::class);
39
-        $twigExtensionEscaper->setEscaper('sql', function () {
39
+        $twigExtensionEscaper->setEscaper('sql', function() {
40 40
             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 .... %}"');
41 41
         });
42 42
 
Please login to merge, or discard this patch.
src/SQLParser/Node/NodeFactory.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
                 }
193 193
 
194 194
                 if (isset($desc['hints']) && $desc['hints']) {
195
-                    $expr->setHints(array_map(static function (array $hint) {
195
+                    $expr->setHints(array_map(static function(array $hint) {
196 196
                         return new Hint($hint['hint_type'], $hint['hint_list']);
197 197
                     }, $desc['hints']));
198 198
                 }
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
             array('NOT'),
513 513
             array('&&', 'AND'),
514 514
             array('XOR'),
515
-            array('||', 'OR'), );
515
+            array('||', 'OR'),);
516 516
 
517 517
     private static $OPERATOR_TO_CLASS = array(
518 518
             '=' => 'SQLParser\Node\Equal',
@@ -819,7 +819,7 @@  discard block
 block discarded – undo
819 819
      */
820 820
     public static function nodeToInstanceDescriptor($node, MoufManager $moufManager)
821 821
     {
822
-        return self::array_map_deep($node, function ($item) use ($moufManager) {
822
+        return self::array_map_deep($node, function($item) use ($moufManager) {
823 823
             if ($item instanceof NodeInterface) {
824 824
                 return $item->toInstanceDescriptor($moufManager);
825 825
             } else {
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
     {
864 864
         if (is_array($nodes)) {
865 865
             $elems = array();
866
-            array_walk_recursive($nodes, function ($item) use (&$elems, $platform, $indent, $parameters, $conditionsMode, $extrapolateParameters) {
866
+            array_walk_recursive($nodes, function($item) use (&$elems, $platform, $indent, $parameters, $conditionsMode, $extrapolateParameters) {
867 867
                 if ($item instanceof SqlRenderInterface) {
868 868
                     $itemSql = $item->toSql($parameters, $platform, $indent, $conditionsMode, $extrapolateParameters);
869 869
                     if ($itemSql !== null) {
Please login to merge, or discard this patch.
src/SQLParser/Node/Table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -233,7 +233,7 @@
 block discarded – undo
233 233
         }
234 234
         if ($this->hints) {
235 235
             foreach ($this->hints as $hint) {
236
-                $sql .= ' ' . $hint->getType() . ' ' . $hint->getList();
236
+                $sql .= ' '.$hint->getType().' '.$hint->getList();
237 237
             }
238 238
         }
239 239
         if ($this->refClause) {
Please login to merge, or discard this patch.
src/SQLParser/Node/AbstractInListOperator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 
25 25
         if ($parameterNode !== null) {
26 26
             if (!isset($parameters[$parameterNode->getName()])) {
27
-                throw new MagicQueryException("Missing parameter '" . $parameterNode->getName() . "' for 'IN' operand.");
27
+                throw new MagicQueryException("Missing parameter '".$parameterNode->getName()."' for 'IN' operand.");
28 28
             }
29 29
             if ($parameters[$parameterNode->getName()] === []) {
30 30
                 return "0 <> 0";
Please login to merge, or discard this patch.
src/SQLParser/Node/Between.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@
 block discarded – undo
174 174
                 $maxBypass = false;
175 175
                 break;
176 176
             default:
177
-                throw new \InvalidArgumentException('Invalid `$conditionsMode`: "' . $conditionsMode. '"');
177
+                throw new \InvalidArgumentException('Invalid `$conditionsMode`: "'.$conditionsMode.'"');
178 178
         }
179 179
 
180 180
         if ($maxBypass && $minBypass) {
Please login to merge, or discard this patch.