@@ -75,12 +75,12 @@ |
||
| 75 | 75 | { |
| 76 | 76 | $result = ''; |
| 77 | 77 | if (!$this->docComment->isEmpty()) { |
| 78 | - $result .= $this->docComment->render($indentLevel) . "\n"; |
|
| 78 | + $result .= $this->docComment->render($indentLevel)."\n"; |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | $result .= $this->addIndent("const {$this->getName()} = ", $indentLevel); |
| 82 | 82 | |
| 83 | 83 | //todo: make indent level work |
| 84 | - return $result . $this->getSerializer()->serialize($this->value); |
|
| 84 | + return $result.$this->getSerializer()->serialize($this->value); |
|
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | \ No newline at end of file |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | { |
| 135 | 135 | $result = ''; |
| 136 | 136 | if (!$this->docComment->isEmpty()) { |
| 137 | - $result .= $this->docComment->render($indentLevel) . "\n"; |
|
| 137 | + $result .= $this->docComment->render($indentLevel)."\n"; |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | $method = "{$this->getAccess()} function {$this->getName()}"; |
@@ -144,11 +144,11 @@ discard block |
||
| 144 | 144 | $method .= "()"; |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - $result .= $this->addIndent($method, $indentLevel) . "\n"; |
|
| 148 | - $result .= $this->addIndent('{', $indentLevel) . "\n"; |
|
| 147 | + $result .= $this->addIndent($method, $indentLevel)."\n"; |
|
| 148 | + $result .= $this->addIndent('{', $indentLevel)."\n"; |
|
| 149 | 149 | |
| 150 | 150 | if (!$this->source->isEmpty()) { |
| 151 | - $result .= $this->source->render($indentLevel + 1) . "\n"; |
|
| 151 | + $result .= $this->source->render($indentLevel + 1)."\n"; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | $result .= $this->addIndent("}", $indentLevel); |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | $result = ''; |
| 294 | 294 | |
| 295 | 295 | if (!$this->docComment->isEmpty()) { |
| 296 | - $result .= $this->docComment->render($indentLevel) . "\n"; |
|
| 296 | + $result .= $this->docComment->render($indentLevel)."\n"; |
|
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | //Class header |
@@ -309,27 +309,27 @@ discard block |
||
| 309 | 309 | $header .= " implements {$interfaces}"; |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | - $result .= $this->addIndent($header, $indentLevel) . "\n"; |
|
| 313 | - $result .= $this->addIndent("{", $indentLevel) . "\n"; |
|
| 312 | + $result .= $this->addIndent($header, $indentLevel)."\n"; |
|
| 313 | + $result .= $this->addIndent("{", $indentLevel)."\n"; |
|
| 314 | 314 | |
| 315 | 315 | //Rendering content |
| 316 | 316 | if (!empty($this->traits)) { |
| 317 | - $result .= $this->renderTraits($indentLevel + 1) . "\n\n"; |
|
| 317 | + $result .= $this->renderTraits($indentLevel + 1)."\n\n"; |
|
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | if (!$this->constants->isEmpty()) { |
| 321 | - $result .= $this->constants->render($indentLevel + 1) . "\n\n"; |
|
| 321 | + $result .= $this->constants->render($indentLevel + 1)."\n\n"; |
|
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | if (!$this->properties->isEmpty()) { |
| 325 | - $result .= $this->properties->render($indentLevel + 1) . "\n\n"; |
|
| 325 | + $result .= $this->properties->render($indentLevel + 1)."\n\n"; |
|
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | if (!$this->methods->isEmpty()) { |
| 329 | - $result .= $this->methods->render($indentLevel + 1) . "\n\n"; |
|
| 329 | + $result .= $this->methods->render($indentLevel + 1)."\n\n"; |
|
| 330 | 330 | } |
| 331 | 331 | |
| 332 | - $result = rtrim($result, "\n") . "\n"; |
|
| 332 | + $result = rtrim($result, "\n")."\n"; |
|
| 333 | 333 | $result .= $this->addIndent("}", $indentLevel); |
| 334 | 334 | |
| 335 | 335 | return $result; |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | protected function expression(string $identifier): string |
| 96 | 96 | { |
| 97 | - return preg_replace_callback('/([a-z][0-9_a-z\.]*\(?)/i', function ($match) { |
|
| 97 | + return preg_replace_callback('/([a-z][0-9_a-z\.]*\(?)/i', function($match) { |
|
| 98 | 98 | $identifier = $match[1]; |
| 99 | 99 | |
| 100 | 100 | //Function name |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | protected function aliasing(string $identifier, string $alias, bool $isTable): string |
| 119 | 119 | { |
| 120 | - $quoted = $this->quote($identifier, $isTable) . ' AS ' . $this->driver->identifier($alias); |
|
| 120 | + $quoted = $this->quote($identifier, $isTable).' AS '.$this->driver->identifier($alias); |
|
| 121 | 121 | |
| 122 | 122 | if ($isTable && strpos($identifier, '.') === false) { |
| 123 | 123 | //We have to apply operation post factum to prevent self aliasing (name AS name) |
@@ -154,12 +154,12 @@ discard block |
||
| 154 | 154 | protected function unpaired(string $identifier, bool $isTable): string |
| 155 | 155 | { |
| 156 | 156 | if ($isTable && !isset($this->aliases[$identifier])) { |
| 157 | - if (!isset($this->aliases[$this->prefix . $identifier])) { |
|
| 157 | + if (!isset($this->aliases[$this->prefix.$identifier])) { |
|
| 158 | 158 | //Generating our alias |
| 159 | - $this->aliases[$this->prefix . $identifier] = $identifier; |
|
| 159 | + $this->aliases[$this->prefix.$identifier] = $identifier; |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | - $identifier = $this->prefix . $identifier; |
|
| 162 | + $identifier = $this->prefix.$identifier; |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | return $this->driver->identifier($identifier); |
@@ -346,7 +346,7 @@ |
||
| 346 | 346 | * @param string $joiner Boolean joiner (AND | OR). |
| 347 | 347 | * @param array $parameters Set of parameters collected from where functions. |
| 348 | 348 | * @param array $tokens Array to aggregate compiled tokens. Reference. |
| 349 | - * @param \Closure|null|callable $wrapper Callback or closure used to wrap/collect every |
|
| 349 | + * @param callable $wrapper Callback or closure used to wrap/collect every |
|
| 350 | 350 | * potential parameter. |
| 351 | 351 | * |
| 352 | 352 | * @throws BuilderException |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | */ |
| 351 | 351 | private function onWrapper() |
| 352 | 352 | { |
| 353 | - return function ($parameter) { |
|
| 353 | + return function($parameter) { |
|
| 354 | 354 | if ($parameter instanceof FragmentInterface) { |
| 355 | 355 | return $parameter; |
| 356 | 356 | } |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | */ |
| 367 | 367 | private function onWhereWrapper() |
| 368 | 368 | { |
| 369 | - return function ($parameter) { |
|
| 369 | + return function($parameter) { |
|
| 370 | 370 | if ($parameter instanceof FragmentInterface) { |
| 371 | 371 | //We are only not creating bindings for plan fragments |
| 372 | 372 | if (!$parameter instanceof ParameterInterface && !$parameter instanceof QueryBuilder) { |
@@ -345,7 +345,7 @@ |
||
| 345 | 345 | */ |
| 346 | 346 | public function hasTable(string $name): bool |
| 347 | 347 | { |
| 348 | - return $this->driver->hasTable($this->prefix . $name); |
|
| 348 | + return $this->driver->hasTable($this->prefix.$name); |
|
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | /** |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | if ($this->isCloseTag($token)) { |
| 74 | 74 | $blockID = $this->uniqueID(); |
| 75 | 75 | |
| 76 | - $this->phpBlocks[$blockID] = $phpBlock . $token[1]; |
|
| 76 | + $this->phpBlocks[$blockID] = $phpBlock.$token[1]; |
|
| 77 | 77 | $isolated .= $this->placeholder($blockID); |
| 78 | 78 | |
| 79 | 79 | $phpBlock = ''; |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | { |
| 139 | 139 | return preg_replace_callback( |
| 140 | 140 | $this->blockRegex(), |
| 141 | - function ($match) use ($partial, $blockIDs) { |
|
| 141 | + function($match) use ($partial, $blockIDs) { |
|
| 142 | 142 | if ($partial && !in_array($match['id'], $blockIDs)) { |
| 143 | 143 | return $match[0]; |
| 144 | 144 | } |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | */ |
| 180 | 180 | private function blockRegex(): string |
| 181 | 181 | { |
| 182 | - return '/' . |
|
| 182 | + return '/'. |
|
| 183 | 183 | preg_quote($this->prefix) |
| 184 | 184 | . '(?P<id>[0-9a-z]+)' |
| 185 | 185 | . preg_quote($this->postfix) |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | */ |
| 192 | 192 | private function uniqueID(): string |
| 193 | 193 | { |
| 194 | - return md5(count($this->phpBlocks) . uniqid(true)); |
|
| 194 | + return md5(count($this->phpBlocks).uniqid(true)); |
|
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | /** |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | */ |
| 202 | 202 | private function placeholder(string $blockID): string |
| 203 | 203 | { |
| 204 | - return $this->prefix . $blockID . $this->postfix; |
|
| 204 | + return $this->prefix.$blockID.$this->postfix; |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | /** |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | string $column = 'id', |
| 156 | 156 | bool $forcePrefix = true |
| 157 | 157 | ): AbstractReference { |
| 158 | - $this->foreignTable = ($forcePrefix ? $this->tablePrefix : '') . $table; |
|
| 158 | + $this->foreignTable = ($forcePrefix ? $this->tablePrefix : '').$table; |
|
| 159 | 159 | $this->foreignKey = $column; |
| 160 | 160 | |
| 161 | 161 | return $this; |
@@ -203,10 +203,10 @@ discard block |
||
| 203 | 203 | $statement[] = 'CONSTRAINT'; |
| 204 | 204 | $statement[] = $driver->identifier($this->name); |
| 205 | 205 | $statement[] = 'FOREIGN KEY'; |
| 206 | - $statement[] = '(' . $driver->identifier($this->column) . ')'; |
|
| 206 | + $statement[] = '('.$driver->identifier($this->column).')'; |
|
| 207 | 207 | |
| 208 | - $statement[] = 'REFERENCES ' . $driver->identifier($this->foreignTable); |
|
| 209 | - $statement[] = '(' . $driver->identifier($this->foreignKey) . ')'; |
|
| 208 | + $statement[] = 'REFERENCES '.$driver->identifier($this->foreignTable); |
|
| 209 | + $statement[] = '('.$driver->identifier($this->foreignKey).')'; |
|
| 210 | 210 | |
| 211 | 211 | $statement[] = "ON DELETE {$this->deleteRule}"; |
| 212 | 212 | $statement[] = "ON UPDATE {$this->updateRule}"; |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $table, |
| 29 | 29 | $columns, |
| 30 | 30 | $rowsets |
| 31 | - ) . (!empty($primaryKey) ? ' RETURNING ' . $this->quote($primaryKey) : ''); |
|
| 31 | + ).(!empty($primaryKey) ? ' RETURNING '.$this->quote($primaryKey) : ''); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
@@ -40,6 +40,6 @@ discard block |
||
| 40 | 40 | return ''; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - return 'DISTINCT' . (is_string($distinct) ? '(' . $this->quote($distinct) . ')' : ''); |
|
| 43 | + return 'DISTINCT'.(is_string($distinct) ? '('.$this->quote($distinct).')' : ''); |
|
| 44 | 44 | } |
| 45 | 45 | } |