@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | - * @return SelectBuilder |
|
| 66 | + * @return QueryCompilerInterface |
|
| 67 | 67 | */ |
| 68 | 68 | public function select() |
| 69 | 69 | { |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | /** |
| 74 | - * @return UpdateBuilder |
|
| 74 | + * @return QueryCompilerInterface |
|
| 75 | 75 | */ |
| 76 | 76 | public function update() |
| 77 | 77 | { |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
| 82 | - * @return DeleteBuilder |
|
| 82 | + * @return QueryCompilerInterface |
|
| 83 | 83 | */ |
| 84 | 84 | public function delete() |
| 85 | 85 | { |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
| 90 | - * @return InsertBuilder |
|
| 90 | + * @return QueryCompilerInterface |
|
| 91 | 91 | */ |
| 92 | 92 | public function insert() |
| 93 | 93 | { |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
| 98 | - * @return InsertSelectBuilder |
|
| 98 | + * @return QueryCompilerInterface |
|
| 99 | 99 | */ |
| 100 | 100 | public function insertSelect() |
| 101 | 101 | { |
@@ -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; |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public function replaceSelfReference(array $args) |
| 67 | 67 | { |
| 68 | - return RecursiveArgs::map($args, function ($arg) { |
|
| 68 | + return RecursiveArgs::map($args, function($arg) { |
|
| 69 | 69 | if (false === is_string($arg)) { |
| 70 | 70 | return $arg; |
| 71 | 71 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | public function addSelect($_) |
| 91 | 91 | { |
| 92 | 92 | $args = $this->replaceSelfReference(func_get_args()); |
| 93 | - $this->getQueryBuilder(function (Clause\SelectInterface $qb) use ($args) { |
|
| 93 | + $this->getQueryBuilder(function(Clause\SelectInterface $qb) use ($args) { |
|
| 94 | 94 | $qb->addSelect($args); |
| 95 | 95 | }); |
| 96 | 96 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function getSelectClauses() |
| 104 | 104 | { |
| 105 | - return $this->getQueryBuilder(function (Clause\SelectInterface $qb) { |
|
| 105 | + return $this->getQueryBuilder(function(Clause\SelectInterface $qb) { |
|
| 106 | 106 | return $qb->getSelectClauses(); |
| 107 | 107 | }); |
| 108 | 108 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | public function getGroupByClauses() |
| 114 | 114 | { |
| 115 | - return $this->getQueryBuilder(function (Clause\GroupByInterface $qb) { |
|
| 115 | + return $this->getQueryBuilder(function(Clause\GroupByInterface $qb) { |
|
| 116 | 116 | return $qb->getGroupByClauses(); |
| 117 | 117 | }); |
| 118 | 118 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | public function isGroupByWithRollUp() |
| 124 | 124 | { |
| 125 | - return $this->getQueryBuilder(function (Clause\GroupByInterface $qb) { |
|
| 125 | + return $this->getQueryBuilder(function(Clause\GroupByInterface $qb) { |
|
| 126 | 126 | return $qb->isGroupByWithRollUp(); |
| 127 | 127 | }); |
| 128 | 128 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | public function addGroupBy($_) |
| 134 | 134 | { |
| 135 | 135 | $args = $this->replaceSelfReference(func_get_args()); |
| 136 | - $this->getQueryBuilder(function (Clause\GroupByInterface $qb) use ($args) { |
|
| 136 | + $this->getQueryBuilder(function(Clause\GroupByInterface $qb) use ($args) { |
|
| 137 | 137 | $qb->addGroupBy($args); |
| 138 | 138 | }); |
| 139 | 139 | |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | public function setGroupByWithRollUp($groupByWithRollUp) |
| 147 | 147 | { |
| 148 | - $this->getQueryBuilder(function (Clause\GroupByInterface $qb) use ($groupByWithRollUp) { |
|
| 148 | + $this->getQueryBuilder(function(Clause\GroupByInterface $qb) use ($groupByWithRollUp) { |
|
| 149 | 149 | $qb->setGroupByWithRollUp($groupByWithRollUp); |
| 150 | 150 | }); |
| 151 | 151 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | public function getHavingClauses() |
| 159 | 159 | { |
| 160 | - return $this->getQueryBuilder(function (Clause\HavingInterface $qb) { |
|
| 160 | + return $this->getQueryBuilder(function(Clause\HavingInterface $qb) { |
|
| 161 | 161 | return $qb->getHavingClauses(); |
| 162 | 162 | }); |
| 163 | 163 | } |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | public function andHaving($_) |
| 169 | 169 | { |
| 170 | 170 | $args = $this->replaceSelfReference(func_get_args()); |
| 171 | - $this->getQueryBuilder(function (Clause\HavingInterface $qb) use ($args) { |
|
| 171 | + $this->getQueryBuilder(function(Clause\HavingInterface $qb) use ($args) { |
|
| 172 | 172 | $qb->andHaving($args); |
| 173 | 173 | }); |
| 174 | 174 | |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | */ |
| 181 | 181 | public function getLimitClause() |
| 182 | 182 | { |
| 183 | - return $this->getQueryBuilder(function (Clause\LimitInterface $qb) { |
|
| 183 | + return $this->getQueryBuilder(function(Clause\LimitInterface $qb) { |
|
| 184 | 184 | return $qb->getLimitClause(); |
| 185 | 185 | }); |
| 186 | 186 | } |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | */ |
| 191 | 191 | public function setLimit($limitClause) |
| 192 | 192 | { |
| 193 | - $this->getQueryBuilder(function (Clause\LimitInterface $qb) use ($limitClause) { |
|
| 193 | + $this->getQueryBuilder(function(Clause\LimitInterface $qb) use ($limitClause) { |
|
| 194 | 194 | $qb->setLimit($limitClause); |
| 195 | 195 | }); |
| 196 | 196 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | */ |
| 203 | 203 | public function getOrderByClauses() |
| 204 | 204 | { |
| 205 | - return $this->getQueryBuilder(function (Clause\OrderByInterface $qb) { |
|
| 205 | + return $this->getQueryBuilder(function(Clause\OrderByInterface $qb) { |
|
| 206 | 206 | return $qb->getOrderByClauses(); |
| 207 | 207 | }); |
| 208 | 208 | } |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | public function addOrderBy($_) |
| 214 | 214 | { |
| 215 | 215 | $args = $this->replaceSelfReference(func_get_args()); |
| 216 | - $this->getQueryBuilder(function (Clause\OrderByInterface $qb) use ($args) { |
|
| 216 | + $this->getQueryBuilder(function(Clause\OrderByInterface $qb) use ($args) { |
|
| 217 | 217 | $qb->addOrderBy($args); |
| 218 | 218 | }); |
| 219 | 219 | |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | */ |
| 226 | 226 | public function getSetClauses() |
| 227 | 227 | { |
| 228 | - return $this->getQueryBuilder(function (Clause\SetInterface $qb) { |
|
| 228 | + return $this->getQueryBuilder(function(Clause\SetInterface $qb) { |
|
| 229 | 229 | return $qb->getSetClauses(); |
| 230 | 230 | }); |
| 231 | 231 | } |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | public function addSet($_) |
| 237 | 237 | { |
| 238 | 238 | $args = $this->replaceSelfReference(func_get_args()); |
| 239 | - $this->getQueryBuilder(function (Clause\SetInterface $qb) use ($args) { |
|
| 239 | + $this->getQueryBuilder(function(Clause\SetInterface $qb) use ($args) { |
|
| 240 | 240 | $qb->addSet($args); |
| 241 | 241 | }); |
| 242 | 242 | |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | */ |
| 249 | 249 | public function getWhereClauses() |
| 250 | 250 | { |
| 251 | - return $this->getQueryBuilder(function (Clause\WhereInterface $qb) { |
|
| 251 | + return $this->getQueryBuilder(function(Clause\WhereInterface $qb) { |
|
| 252 | 252 | return $qb->getWhereClauses(); |
| 253 | 253 | }); |
| 254 | 254 | } |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | public function andWhere($_) |
| 260 | 260 | { |
| 261 | 261 | $args = $this->replaceSelfReference(func_get_args()); |
| 262 | - $this->getQueryBuilder(function (Clause\WhereInterface $qb) use ($args) { |
|
| 262 | + $this->getQueryBuilder(function(Clause\WhereInterface $qb) use ($args) { |
|
| 263 | 263 | $qb->andWhere($args); |
| 264 | 264 | }); |
| 265 | 265 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public function addOrderBy($_) |
| 32 | 32 | { |
| 33 | - RecursiveArgs::each(func_get_args(), function ($arg) { |
|
| 33 | + RecursiveArgs::each(func_get_args(), function($arg) { |
|
| 34 | 34 | $this->orderByClauses[] = $arg; |
| 35 | 35 | }); |
| 36 | 36 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public function andHaving($_) |
| 32 | 32 | { |
| 33 | - RecursiveArgs::each(func_get_args(), function ($arg) { |
|
| 33 | + RecursiveArgs::each(func_get_args(), function($arg) { |
|
| 34 | 34 | $this->havingClauses[] = $arg; |
| 35 | 35 | }); |
| 36 | 36 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public function addSet($_) |
| 32 | 32 | { |
| 33 | - RecursiveArgs::each(func_get_args(), function ($arg) { |
|
| 33 | + RecursiveArgs::each(func_get_args(), function($arg) { |
|
| 34 | 34 | $this->setClauses[] = $arg; |
| 35 | 35 | }); |
| 36 | 36 | |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | public function addSelect($_) |
| 32 | 32 | { |
| 33 | 33 | RecursiveArgs::each(func_get_args(), function ($arg) { |
| 34 | - $this->selectClauses[] = $arg; |
|
| 34 | + $this->selectClauses[] = $arg; |
|
| 35 | 35 | }); |
| 36 | 36 | |
| 37 | 37 | return $this; |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public function addSelect($_) |
| 32 | 32 | { |
| 33 | - RecursiveArgs::each(func_get_args(), function ($arg) { |
|
| 33 | + RecursiveArgs::each(func_get_args(), function($arg) { |
|
| 34 | 34 | $this->selectClauses[] = $arg; |
| 35 | 35 | }); |
| 36 | 36 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public function andWhere($_) |
| 32 | 32 | { |
| 33 | - RecursiveArgs::each(func_get_args(), function ($arg) { |
|
| 33 | + RecursiveArgs::each(func_get_args(), function($arg) { |
|
| 34 | 34 | $this->whereClauses[] = $arg; |
| 35 | 35 | }); |
| 36 | 36 | |