@@ -98,8 +98,8 @@ |
||
| 98 | 98 | $builder = $payload->getBuilder(); |
| 99 | 99 | |
| 100 | 100 | if ($builder instanceof Component\InsertValuesComponentInterface) { |
| 101 | - $newSQL = 'VALUES ' . implode(', ', array_map(function (array $values) { |
|
| 102 | - return '('. implode(', ', $values) . ')'; |
|
| 101 | + $newSQL = 'VALUES ' . implode(', ', array_map(function(array $values) { |
|
| 102 | + return '(' . implode(', ', $values) . ')'; |
|
| 103 | 103 | }, $builder->getValues())); |
| 104 | 104 | $payload = $payload->appendSQL($newSQL); |
| 105 | 105 | } |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | private function convertReferenceToValue($reference) |
| 63 | 63 | { |
| 64 | 64 | if (is_string($reference)) { |
| 65 | - return "\"" . $reference ."\""; |
|
| 65 | + return "\"" . $reference . "\""; |
|
| 66 | 66 | } elseif ($reference instanceof AbstractTable) { |
| 67 | 67 | return $reference->getAliasOrName(); |
| 68 | 68 | } elseif ($reference instanceof QueryComponentInterface) { |
@@ -11,8 +11,8 @@ |
||
| 11 | 11 | |
| 12 | 12 | namespace Phuria\UnderQuery\Table; |
| 13 | 13 | |
| 14 | -use Phuria\UnderQuery\QueryBuilder\Clause as Clause; |
|
| 15 | 14 | use Phuria\UnderQuery\QueryBuilder\BuilderInterface; |
| 15 | +use Phuria\UnderQuery\QueryBuilder\Clause as Clause; |
|
| 16 | 16 | use Phuria\UnderQuery\QueryBuilder\Clause\OrderByInterface; |
| 17 | 17 | use Phuria\UnderQuery\QueryBuilder\Clause\SetInterface; |
| 18 | 18 | use Phuria\UnderQuery\QueryBuilder\Clause\WhereInterface; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | public function replaceSelfReference(array $args) |
| 70 | 70 | { |
| 71 | - return RecursiveArgs::map($args, function ($arg) { |
|
| 71 | + return RecursiveArgs::map($args, function($arg) { |
|
| 72 | 72 | return $this->createRelativeClause($arg); |
| 73 | 73 | }); |
| 74 | 74 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | public function addSelect($_) |
| 100 | 100 | { |
| 101 | 101 | $args = $this->replaceSelfReference(func_get_args()); |
| 102 | - $this->getQueryBuilder(function (Clause\SelectInterface $qb) use ($args) { |
|
| 102 | + $this->getQueryBuilder(function(Clause\SelectInterface $qb) use ($args) { |
|
| 103 | 103 | $qb->addSelect($args); |
| 104 | 104 | }); |
| 105 | 105 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public function getSelectClauses() |
| 113 | 113 | { |
| 114 | - return $this->getQueryBuilder(function (Clause\SelectInterface $qb) { |
|
| 114 | + return $this->getQueryBuilder(function(Clause\SelectInterface $qb) { |
|
| 115 | 115 | return $qb->getSelectClauses(); |
| 116 | 116 | }); |
| 117 | 117 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | public function getGroupByClauses() |
| 123 | 123 | { |
| 124 | - return $this->getQueryBuilder(function (Clause\GroupByInterface $qb) { |
|
| 124 | + return $this->getQueryBuilder(function(Clause\GroupByInterface $qb) { |
|
| 125 | 125 | return $qb->getGroupByClauses(); |
| 126 | 126 | }); |
| 127 | 127 | } |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | public function isGroupByWithRollUp() |
| 133 | 133 | { |
| 134 | - return $this->getQueryBuilder(function (Clause\GroupByInterface $qb) { |
|
| 134 | + return $this->getQueryBuilder(function(Clause\GroupByInterface $qb) { |
|
| 135 | 135 | return $qb->isGroupByWithRollUp(); |
| 136 | 136 | }); |
| 137 | 137 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | public function addGroupBy($_) |
| 143 | 143 | { |
| 144 | 144 | $args = $this->replaceSelfReference(func_get_args()); |
| 145 | - $this->getQueryBuilder(function (Clause\GroupByInterface $qb) use ($args) { |
|
| 145 | + $this->getQueryBuilder(function(Clause\GroupByInterface $qb) use ($args) { |
|
| 146 | 146 | $qb->addGroupBy($args); |
| 147 | 147 | }); |
| 148 | 148 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | public function setGroupByWithRollUp($groupByWithRollUp) |
| 156 | 156 | { |
| 157 | - $this->getQueryBuilder(function (Clause\GroupByInterface $qb) use ($groupByWithRollUp) { |
|
| 157 | + $this->getQueryBuilder(function(Clause\GroupByInterface $qb) use ($groupByWithRollUp) { |
|
| 158 | 158 | $qb->setGroupByWithRollUp($groupByWithRollUp); |
| 159 | 159 | }); |
| 160 | 160 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | */ |
| 167 | 167 | public function getHavingClauses() |
| 168 | 168 | { |
| 169 | - return $this->getQueryBuilder(function (Clause\HavingInterface $qb) { |
|
| 169 | + return $this->getQueryBuilder(function(Clause\HavingInterface $qb) { |
|
| 170 | 170 | return $qb->getHavingClauses(); |
| 171 | 171 | }); |
| 172 | 172 | } |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | public function andHaving($_) |
| 178 | 178 | { |
| 179 | 179 | $args = $this->replaceSelfReference(func_get_args()); |
| 180 | - $this->getQueryBuilder(function (Clause\HavingInterface $qb) use ($args) { |
|
| 180 | + $this->getQueryBuilder(function(Clause\HavingInterface $qb) use ($args) { |
|
| 181 | 181 | $qb->andHaving($args); |
| 182 | 182 | }); |
| 183 | 183 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | */ |
| 190 | 190 | public function getLimitClause() |
| 191 | 191 | { |
| 192 | - return $this->getQueryBuilder(function (Clause\LimitInterface $qb) { |
|
| 192 | + return $this->getQueryBuilder(function(Clause\LimitInterface $qb) { |
|
| 193 | 193 | return $qb->getLimitClause(); |
| 194 | 194 | }); |
| 195 | 195 | } |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | */ |
| 200 | 200 | public function setLimit($limitClause) |
| 201 | 201 | { |
| 202 | - $this->getQueryBuilder(function (Clause\LimitInterface $qb) use ($limitClause) { |
|
| 202 | + $this->getQueryBuilder(function(Clause\LimitInterface $qb) use ($limitClause) { |
|
| 203 | 203 | $qb->setLimit($limitClause); |
| 204 | 204 | }); |
| 205 | 205 | |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | */ |
| 212 | 212 | public function getOrderByClauses() |
| 213 | 213 | { |
| 214 | - return $this->getQueryBuilder(function (Clause\OrderByInterface $qb) { |
|
| 214 | + return $this->getQueryBuilder(function(Clause\OrderByInterface $qb) { |
|
| 215 | 215 | return $qb->getOrderByClauses(); |
| 216 | 216 | }); |
| 217 | 217 | } |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | public function addOrderBy($_) |
| 223 | 223 | { |
| 224 | 224 | $args = $this->replaceSelfReference(func_get_args()); |
| 225 | - $this->getQueryBuilder(function (Clause\OrderByInterface $qb) use ($args) { |
|
| 225 | + $this->getQueryBuilder(function(Clause\OrderByInterface $qb) use ($args) { |
|
| 226 | 226 | $qb->addOrderBy($args); |
| 227 | 227 | }); |
| 228 | 228 | |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | */ |
| 235 | 235 | public function getSetClauses() |
| 236 | 236 | { |
| 237 | - return $this->getQueryBuilder(function (Clause\SetInterface $qb) { |
|
| 237 | + return $this->getQueryBuilder(function(Clause\SetInterface $qb) { |
|
| 238 | 238 | return $qb->getSetClauses(); |
| 239 | 239 | }); |
| 240 | 240 | } |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | public function addSet($_) |
| 246 | 246 | { |
| 247 | 247 | $args = $this->replaceSelfReference(func_get_args()); |
| 248 | - $this->getQueryBuilder(function (Clause\SetInterface $qb) use ($args) { |
|
| 248 | + $this->getQueryBuilder(function(Clause\SetInterface $qb) use ($args) { |
|
| 249 | 249 | $qb->addSet($args); |
| 250 | 250 | }); |
| 251 | 251 | |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | */ |
| 258 | 258 | public function getWhereClauses() |
| 259 | 259 | { |
| 260 | - return $this->getQueryBuilder(function (Clause\WhereInterface $qb) { |
|
| 260 | + return $this->getQueryBuilder(function(Clause\WhereInterface $qb) { |
|
| 261 | 261 | return $qb->getWhereClauses(); |
| 262 | 262 | }); |
| 263 | 263 | } |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | public function andWhere($_) |
| 269 | 269 | { |
| 270 | 270 | $args = $this->replaceSelfReference(func_get_args()); |
| 271 | - $this->getQueryBuilder(function (Clause\WhereInterface $qb) use ($args) { |
|
| 271 | + $this->getQueryBuilder(function(Clause\WhereInterface $qb) use ($args) { |
|
| 272 | 272 | $qb->andWhere($args); |
| 273 | 273 | }); |
| 274 | 274 | |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | */ |
| 281 | 281 | public function getJoinTables() |
| 282 | 282 | { |
| 283 | - return $this->getQueryBuilder(function (Clause\JoinInterface $qb) { |
|
| 283 | + return $this->getQueryBuilder(function(Clause\JoinInterface $qb) { |
|
| 284 | 284 | return $qb->getJoinTables(); |
| 285 | 285 | }); |
| 286 | 286 | } |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | */ |
| 291 | 291 | public function doJoin($joinType, $table, $alias = null, $joinOn = null) |
| 292 | 292 | { |
| 293 | - return $this->getQueryBuilder(function (Clause\JoinInterface $qb) use ($joinType, $table, $alias, $joinOn) { |
|
| 293 | + return $this->getQueryBuilder(function(Clause\JoinInterface $qb) use ($joinType, $table, $alias, $joinOn) { |
|
| 294 | 294 | $relativeJoin = $this->createRelativeClause($joinOn); |
| 295 | 295 | return $qb->doJoin($joinType, $table, $alias, $relativeJoin); |
| 296 | 296 | }); |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | public function addGroupBy($_) |
| 37 | 37 | { |
| 38 | - RecursiveArgs::each(func_get_args(), function ($arg) { |
|
| 38 | + RecursiveArgs::each(func_get_args(), function($arg) { |
|
| 39 | 39 | $this->groupByClauses[] = $arg; |
| 40 | 40 | }); |
| 41 | 41 | |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | { |
| 42 | 42 | $collection = []; |
| 43 | 43 | |
| 44 | - static::each($args, function ($arg) use (&$collection, $resolver) { |
|
| 44 | + static::each($args, function($arg) use (&$collection, $resolver) { |
|
| 45 | 45 | $collection[] = $resolver($arg); |
| 46 | 46 | }); |
| 47 | 47 | |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | public function addGroupBy($_) |
| 37 | 37 | { |
| 38 | - RecursiveArgs::each(func_get_args(), function ($arg) { |
|
| 38 | + RecursiveArgs::each(func_get_args(), function($arg) { |
|
| 39 | 39 | $this->groupByClauses[] = $arg; |
| 40 | 40 | }); |
| 41 | 41 | |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | public function addGroupBy($_) |
| 37 | 37 | { |
| 38 | - RecursiveArgs::each(func_get_args(), function ($arg) { |
|
| 38 | + RecursiveArgs::each(func_get_args(), function($arg) { |
|
| 39 | 39 | $this->groupByClauses[] = $arg; |
| 40 | 40 | }); |
| 41 | 41 | |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | public function addGroupBy($_) |
| 37 | 37 | { |
| 38 | - RecursiveArgs::each(func_get_args(), function ($arg) { |
|
| 38 | + RecursiveArgs::each(func_get_args(), function($arg) { |
|
| 39 | 39 | $this->groupByClauses[] = $arg; |
| 40 | 40 | }); |
| 41 | 41 | |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | public function addGroupBy($_) |
| 37 | 37 | { |
| 38 | - RecursiveArgs::each(func_get_args(), function ($arg) { |
|
| 38 | + RecursiveArgs::each(func_get_args(), function($arg) { |
|
| 39 | 39 | $this->groupByClauses[] = $arg; |
| 40 | 40 | }); |
| 41 | 41 | |