@@ -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; |
@@ -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 | } |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | //Resolve table primary key if any |
| 38 | - $primary = $driver->getPrimary($this->database->getPrefix() . $this->table); |
|
| 38 | + $primary = $driver->getPrimary($this->database->getPrefix().$this->table); |
|
| 39 | 39 | |
| 40 | 40 | if (empty($compiler)) { |
| 41 | 41 | $compiler = $this->compiler->resetQuoter(); |
@@ -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); |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | * @param array|\Closure $where Selection WHERE statement. |
| 43 | 43 | * @param array $load Array or relations to be pre-loaded. |
| 44 | 44 | * @param array $orderBy Sort by conditions. |
| 45 | - * @return RecordEntity|null |
|
| 45 | + * @return null|\Spiral\ORM\RecordInterface |
|
| 46 | 46 | */ |
| 47 | 47 | public static function findOne($where = [], array $load = [], array $orderBy = []) |
| 48 | 48 | { |
@@ -228,7 +228,7 @@ |
||
| 228 | 228 | * Execute statement. |
| 229 | 229 | * |
| 230 | 230 | * @param string $statement |
| 231 | - * @param array $parameters |
|
| 231 | + * @param string[] $parameters |
|
| 232 | 232 | * @return \PDOStatement |
| 233 | 233 | */ |
| 234 | 234 | protected function run($statement, array $parameters = []) |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | if (!empty($table->getPrimaryKeys())) { |
| 286 | 286 | $primaryKeys = array_map([$this, 'quote'], $table->getPrimaryKeys()); |
| 287 | 287 | |
| 288 | - $innerStatement[] = 'PRIMARY KEY (' . implode(', ', $primaryKeys) . ')'; |
|
| 288 | + $innerStatement[] = 'PRIMARY KEY ('.implode(', ', $primaryKeys).')'; |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | //Constraints and foreign keys |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | $innerStatement[] = $reference->sqlStatement(); |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | - $statement[] = ' ' . implode(",\n ", $innerStatement); |
|
| 296 | + $statement[] = ' '.implode(",\n ", $innerStatement); |
|
| 297 | 297 | $statement[] = ')'; |
| 298 | 298 | |
| 299 | 299 | return implode("\n", $statement); |
@@ -162,7 +162,7 @@ |
||
| 162 | 162 | protected function generateName() |
| 163 | 163 | { |
| 164 | 164 | //We can generate name |
| 165 | - $name = $this->table->getName() . '_index_' . implode('_', $this->columns) . '_' . uniqid(); |
|
| 165 | + $name = $this->table->getName().'_index_'.implode('_', $this->columns).'_'.uniqid(); |
|
| 166 | 166 | |
| 167 | 167 | if (strlen($name) > 64) { |
| 168 | 168 | //Many dbs has limitations on identifier length |
@@ -748,7 +748,7 @@ |
||
| 748 | 748 | } |
| 749 | 749 | |
| 750 | 750 | if (!empty($enumValues)) { |
| 751 | - return '(' . implode(', ', $enumValues) . ')'; |
|
| 751 | + return '('.implode(', ', $enumValues).')'; |
|
| 752 | 752 | } |
| 753 | 753 | |
| 754 | 754 | return ''; |
@@ -164,7 +164,7 @@ |
||
| 164 | 164 | */ |
| 165 | 165 | public function setName($name) |
| 166 | 166 | { |
| 167 | - parent::setName($this->prefix . $name); |
|
| 167 | + parent::setName($this->prefix.$name); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | /** |