| @@ -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); | 
| @@ -168,7 +168,6 @@ | ||
| 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) | 
| @@ -137,7 +137,7 @@ | ||
| 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); | 
| @@ -166,7 +166,7 @@ | ||
| 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 { | 
| @@ -36,7 +36,7 @@ | ||
| 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 | |
| @@ -192,7 +192,7 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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) { | 
| @@ -233,7 +233,7 @@ | ||
| 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) { | 
| @@ -24,7 +24,7 @@ | ||
| 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"; | 
| @@ -174,7 +174,7 @@ | ||
| 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) { | 
| @@ -105,7 +105,7 @@ | ||
| 105 | 105 | return $select->toSql($parameters, $platform, $indent, $conditionsMode, $extrapolateParameters); | 
| 106 | 106 | }, $this->selects); | 
| 107 | 107 | |
| 108 | -        $sql = '(' . implode(') UNION (', $selectsSql) . ')'; | |
| 108 | +        $sql = '('.implode(') UNION (', $selectsSql).')'; | |
| 109 | 109 | |
| 110 | 110 |          if (!empty($this->order)) { | 
| 111 | 111 | $order = NodeFactory::toSql($this->order, $platform, $parameters, ',', false, $indent + 2, $conditionsMode, $extrapolateParameters); |