@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * Register new JOIN with specified type with set of on conditions (linking one table to |
82 | 82 | * another, no parametric on conditions allowed here). |
83 | 83 | * |
84 | - * @param string|QueryBuilder $type Join type. Allowed values, LEFT, RIGHT, INNER and etc. |
|
84 | + * @param string $type Join type. Allowed values, LEFT, RIGHT, INNER and etc. |
|
85 | 85 | * @param string $outer Joined table name (without prefix), may include AS |
86 | 86 | * statement. |
87 | 87 | * @param string $alias Joined table or query alias. |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | * @link http://www.w3schools.com/sql/sql_join_inner.asp |
111 | 111 | * @see join() |
112 | 112 | * |
113 | - * @param string|QueryBuilder $outer Joined table name (without prefix), may include AS |
|
113 | + * @param string $outer Joined table name (without prefix), may include AS |
|
114 | 114 | * statement. |
115 | 115 | * @param string $alias Joined table or query alias. |
116 | 116 | * |
@@ -220,6 +220,7 @@ discard block |
||
220 | 220 | * together, no parametric values allowed. |
221 | 221 | * |
222 | 222 | * @param mixed ...$args [(column, outer column), (column, operator, outer column)] |
223 | + * @param null|string $args |
|
223 | 224 | * |
224 | 225 | * @return $this |
225 | 226 | * |
@@ -361,7 +362,7 @@ discard block |
||
361 | 362 | * @param string $joiner Boolean joiner (AND | OR). |
362 | 363 | * @param array $parameters Set of parameters collected from where functions. |
363 | 364 | * @param array $tokens Array to aggregate compiled tokens. Reference. |
364 | - * @param \Closure|null|callable $wrapper Callback or closure used to wrap/collect every |
|
365 | + * @param callable $wrapper Callback or closure used to wrap/collect every |
|
365 | 366 | * potential parameter. |
366 | 367 | * |
367 | 368 | * @throws BuilderException |
@@ -83,14 +83,14 @@ discard block |
||
83 | 83 | if ($this->isJoined()) { |
84 | 84 | $query->join( |
85 | 85 | $this->getMethod() == self::JOIN ? 'INNER' : 'LEFT', |
86 | - $this->pivotTable() . ' AS ' . $this->pivotAlias()) |
|
86 | + $this->pivotTable().' AS '.$this->pivotAlias()) |
|
87 | 87 | ->on( |
88 | 88 | $this->pivotKey(Record::THOUGHT_INNER_KEY), |
89 | 89 | $this->parentKey(Record::INNER_KEY) |
90 | 90 | ); |
91 | 91 | } else { |
92 | 92 | $query->innerJoin( |
93 | - $this->pivotTable() . ' AS ' . $this->pivotAlias()) |
|
93 | + $this->pivotTable().' AS '.$this->pivotAlias()) |
|
94 | 94 | ->on( |
95 | 95 | $this->pivotKey(Record::THOUGHT_OUTER_KEY), |
96 | 96 | $this->localKey(Record::OUTER_KEY) |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | //Actual data is always INNER join |
129 | 129 | $query->join( |
130 | 130 | $this->getMethod() == self::JOIN ? 'INNER' : 'LEFT', |
131 | - $this->getTable() . ' AS ' . $this->getAlias() |
|
131 | + $this->getTable().' AS '.$this->getAlias() |
|
132 | 132 | )->on( |
133 | 133 | $this->localKey(Record::OUTER_KEY), |
134 | 134 | $this->pivotKey(Record::THOUGHT_OUTER_KEY) |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | |
169 | 169 | if ($minify) { |
170 | 170 | //Let's use column number instead of full name |
171 | - $column = 'p_c' . count($columns); |
|
171 | + $column = 'p_c'.count($columns); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | $columns[] = "{$alias}.{$name} AS {$prefix}{$column}"; |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | return $this->options['pivotAlias']; |
218 | 218 | } |
219 | 219 | |
220 | - return $this->getAlias() . '_pivot'; |
|
220 | + return $this->getAlias().'_pivot'; |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | /** |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | return null; |
244 | 244 | } |
245 | 245 | |
246 | - return $this->pivotAlias() . '.' . $this->schema[$key]; |
|
246 | + return $this->pivotAlias().'.'.$this->schema[$key]; |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | /** |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | return null; |
235 | 235 | } |
236 | 236 | |
237 | - return $this->getAlias() . '.' . $this->schema[$key]; |
|
237 | + return $this->getAlias().'.'.$this->schema[$key]; |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | /** |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | */ |
247 | 247 | protected function parentKey($key): string |
248 | 248 | { |
249 | - return $this->parent->getAlias() . '.' . $this->schema[$key]; |
|
249 | + return $this->parent->getAlias().'.'.$this->schema[$key]; |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
@@ -260,10 +260,10 @@ discard block |
||
260 | 260 | if (empty($this->options['alias'])) { |
261 | 261 | if ($this->isLoaded() && $this->isJoined()) { |
262 | 262 | //Let's create unique alias, we are able to do that for relations just loaded |
263 | - $this->options['alias'] = 'd' . decoct(++self::$countLevels); |
|
263 | + $this->options['alias'] = 'd'.decoct(++self::$countLevels); |
|
264 | 264 | } else { |
265 | 265 | //Let's use parent alias to continue chain |
266 | - $this->options['alias'] = $parent->getAlias() . '_' . $this->relation; |
|
266 | + $this->options['alias'] = $parent->getAlias().'_'.$this->relation; |
|
267 | 267 | } |
268 | 268 | } |
269 | 269 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | protected function expression(string $identifier): string |
115 | 115 | { |
116 | - return preg_replace_callback('/([a-z][0-9_a-z\.]*\(?)/i', function ($match) { |
|
116 | + return preg_replace_callback('/([a-z][0-9_a-z\.]*\(?)/i', function($match) { |
|
117 | 117 | $identifier = $match[1]; |
118 | 118 | |
119 | 119 | //Function name |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | */ |
137 | 137 | protected function aliasing(string $identifier, string $alias, bool $isTable): string |
138 | 138 | { |
139 | - $quoted = $this->quote($identifier, $isTable) . ' AS ' . $this->driver->identifier($alias); |
|
139 | + $quoted = $this->quote($identifier, $isTable).' AS '.$this->driver->identifier($alias); |
|
140 | 140 | |
141 | 141 | if ($isTable && strpos($identifier, '.') === false) { |
142 | 142 | //We have to apply operation post factum to prevent self aliasing (name AS name) |
@@ -173,12 +173,12 @@ discard block |
||
173 | 173 | protected function unpaired(string $identifier, bool $isTable): string |
174 | 174 | { |
175 | 175 | if ($isTable && !isset($this->aliases[$identifier])) { |
176 | - if (!isset($this->aliases[$this->prefix . $identifier])) { |
|
176 | + if (!isset($this->aliases[$this->prefix.$identifier])) { |
|
177 | 177 | //Generating our alias |
178 | - $this->registerAlias($this->prefix . $identifier, $identifier); |
|
178 | + $this->registerAlias($this->prefix.$identifier, $identifier); |
|
179 | 179 | } |
180 | 180 | |
181 | - $identifier = $this->prefix . $identifier; |
|
181 | + $identifier = $this->prefix.$identifier; |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | return $this->driver->identifier($identifier); |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | |
325 | 325 | if (!empty($join['alias'])) { |
326 | 326 | $this->quoter->registerAlias($join['alias'], (string)$join['outer']); |
327 | - $statement .= " AS " . $this->quote($join['alias']); |
|
327 | + $statement .= " AS ".$this->quote($join['alias']); |
|
328 | 328 | } |
329 | 329 | |
330 | 330 | $statement .= $this->optional("\n ON", $this->compileWhere($join['on'])); |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | throw new CompilerException("Invalid sorting direction, only ASC and DESC are allowed"); |
379 | 379 | } |
380 | 380 | |
381 | - $result[] = $this->quote($order[0]) . ' ' . $direction; |
|
381 | + $result[] = $this->quote($order[0]).' '.$direction; |
|
382 | 382 | } |
383 | 383 | |
384 | 384 | return implode(', ', $result); |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | $prefix .= ' '; |
545 | 545 | } |
546 | 546 | |
547 | - return $prefix . $expression . $postfix; |
|
547 | + return $prefix.$expression.$postfix; |
|
548 | 548 | } |
549 | 549 | |
550 | 550 | /** |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | { |
604 | 604 | if ($context instanceof QueryBuilder) { |
605 | 605 | //Nested queries has to be wrapped with braces |
606 | - return '(' . $context->sqlStatement($this) . ')'; |
|
606 | + return '('.$context->sqlStatement($this).')'; |
|
607 | 607 | } |
608 | 608 | |
609 | 609 | if ($context instanceof ExpressionInterface) { |