@@ -106,6 +106,6 @@ |
||
106 | 106 | $pivotData = $data[ORMInterface::PIVOT_DATA]; |
107 | 107 | |
108 | 108 | //Unique row criteria |
109 | - return $pivotData[$this->innerPivotKey] . '.' . $pivotData[$this->outerPivotKey]; |
|
109 | + return $pivotData[$this->innerPivotKey].'.'.$pivotData[$this->outerPivotKey]; |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | \ No newline at end of file |
@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | if ($this->isJoined()) { |
48 | 48 | $query->join( |
49 | 49 | $this->getMethod() == self::LEFT_JOIN ? 'LEFT' : 'INNER', |
50 | - $this->pivotTable() . ' AS ' . $this->pivotAlias(), |
|
50 | + $this->pivotTable().' AS '.$this->pivotAlias(), |
|
51 | 51 | [$this->pivotKey(Record::THOUGHT_INNER_KEY) => $this->parentKey(Record::INNER_KEY)] |
52 | 52 | ); |
53 | 53 | } else { |
54 | 54 | $query->innerJoin( |
55 | - $this->pivotTable() . ' AS ' . $this->pivotAlias(), |
|
55 | + $this->pivotTable().' AS '.$this->pivotAlias(), |
|
56 | 56 | [$this->pivotKey(Record::THOUGHT_OUTER_KEY) => $this->localKey(Record::OUTER_KEY)] |
57 | 57 | )->where( |
58 | 58 | $this->pivotKey(Record::THOUGHT_INNER_KEY), |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | if ($this->isJoined()) { |
73 | 73 | $query->join( |
74 | 74 | $this->getMethod() == self::LEFT_JOIN ? 'LEFT' : 'INNER', |
75 | - $this->getTable() . ' AS ' . $this->getAlias(), |
|
75 | + $this->getTable().' AS '.$this->getAlias(), |
|
76 | 76 | [$this->localKey(Record::OUTER_KEY) => $this->pivotKey(Record::THOUGHT_OUTER_KEY)] |
77 | 77 | ); |
78 | 78 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | if ($minify) { |
112 | 112 | //Let's use column number instead of full name |
113 | - $column = 'p_c' . count($columns); |
|
113 | + $column = 'p_c'.count($columns); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | $columns[] = "{$alias}.{$name} AS {$prefix}{$column}"; |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | return $this->options['pivotAlias']; |
160 | 160 | } |
161 | 161 | |
162 | - return $this->getAlias() . '_pivot'; |
|
162 | + return $this->getAlias().'_pivot'; |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
@@ -185,6 +185,6 @@ discard block |
||
185 | 185 | return null; |
186 | 186 | } |
187 | 187 | |
188 | - return $this->pivotAlias() . '.' . $this->schema[$key]; |
|
188 | + return $this->pivotAlias().'.'.$this->schema[$key]; |
|
189 | 189 | } |
190 | 190 | } |
191 | 191 | \ No newline at end of file |
@@ -424,7 +424,7 @@ |
||
424 | 424 | |
425 | 425 | if (!$injector instanceof InjectorInterface) { |
426 | 426 | throw new InjectionException( |
427 | - "Class '" . get_class($injector) . "' must be an instance of InjectorInterface for '{$reflection->getName()}'" |
|
427 | + "Class '".get_class($injector)."' must be an instance of InjectorInterface for '{$reflection->getName()}'" |
|
428 | 428 | ); |
429 | 429 | } |
430 | 430 |
@@ -426,7 +426,7 @@ |
||
426 | 426 | ): AccessorInterface { |
427 | 427 | if (!is_string($accessor) || !class_exists($accessor)) { |
428 | 428 | throw new EntityException( |
429 | - "Unable to create accessor for field {$name} in " . static::class |
|
429 | + "Unable to create accessor for field {$name} in ".static::class |
|
430 | 430 | ); |
431 | 431 | } |
432 | 432 |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | $args[0] = $this->prepare($args[0]); |
130 | 130 | |
131 | 131 | //Routing where |
132 | - call_user_func_array([$this->query, 'and' . ucfirst($this->target)], $args); |
|
132 | + call_user_func_array([$this->query, 'and'.ucfirst($this->target)], $args); |
|
133 | 133 | |
134 | 134 | return $this; |
135 | 135 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $args[0] = $this->prepare($args[0]); |
159 | 159 | |
160 | 160 | //Routing where |
161 | - call_user_func_array([$this->query, 'or' . ucfirst($this->target)], $args); |
|
161 | + call_user_func_array([$this->query, 'or'.ucfirst($this->target)], $args); |
|
162 | 162 | |
163 | 163 | return $this; |
164 | 164 | } |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | * @param bool $changedEntities Reference, will be set to true if any of entities changed |
260 | 260 | * internally. |
261 | 261 | */ |
262 | - public function hasChanges(bool &$changedEntities = null): bool |
|
262 | + public function hasChanges(bool & $changedEntities = null): bool |
|
263 | 263 | { |
264 | 264 | foreach ($this->entities as $entity) { |
265 | 265 | if ($entity->hasChanges()) { |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | |
327 | 327 | $atomics = array_merge( |
328 | 328 | $atomics, |
329 | - $entity->buildAtomics((!empty($container) ? $container . '.' : '') . $offset) |
|
329 | + $entity->buildAtomics((!empty($container) ? $container.'.' : '').$offset) |
|
330 | 330 | ); |
331 | 331 | } |
332 | 332 |
@@ -78,7 +78,7 @@ |
||
78 | 78 | */ |
79 | 79 | public function primaryKey(): string |
80 | 80 | { |
81 | - return $this->getAlias() . '.' . $this->schema[Record::SH_PRIMARY_KEY]; |
|
81 | + return $this->getAlias().'.'.$this->schema[Record::SH_PRIMARY_KEY]; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | |
269 | 269 | //Dropping enum constrain before any operation |
270 | 270 | if ($initial->abstractType() == 'enum' && $this->constrained) { |
271 | - $operations[] = 'DROP CONSTRAINT ' . $driver->identifier($this->enumConstraint()); |
|
271 | + $operations[] = 'DROP CONSTRAINT '.$driver->identifier($this->enumConstraint()); |
|
272 | 272 | } |
273 | 273 | |
274 | 274 | //Default value set and dropping |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | |
283 | 283 | //Nullable option |
284 | 284 | if ($initial->nullable != $this->nullable) { |
285 | - $operations[] = "ALTER COLUMN {$identifier} " . (!$this->nullable ? 'SET' : 'DROP') . ' NOT NULL'; |
|
285 | + $operations[] = "ALTER COLUMN {$identifier} ".(!$this->nullable ? 'SET' : 'DROP').' NOT NULL'; |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | if ($this->abstractType() == 'enum') { |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | } |
293 | 293 | |
294 | 294 | $operations[] = "ADD CONSTRAINT {$driver->identifier($this->enumConstraint())} " |
295 | - . "CHECK ({$identifier} IN (" . implode(', ', $enumValues) . '))'; |
|
295 | + . "CHECK ({$identifier} IN (".implode(', ', $enumValues).'))'; |
|
296 | 296 | } |
297 | 297 | |
298 | 298 | return $operations; |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | protected function quoteEnum(Driver $driver): string |
305 | 305 | { |
306 | 306 | //Postgres enums are just constrained strings |
307 | - return '(' . $this->size . ')'; |
|
307 | + return '('.$this->size.')'; |
|
308 | 308 | } |
309 | 309 | |
310 | 310 | /** |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | private function enumConstraint(): string |
316 | 316 | { |
317 | 317 | if (empty($this->constrainName)) { |
318 | - $this->constrainName = $this->table . '_' . $this->getName() . '_enum_' . uniqid(); |
|
318 | + $this->constrainName = $this->table.'_'.$this->getName().'_enum_'.uniqid(); |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | return $this->constrainName; |
@@ -419,11 +419,11 @@ discard block |
||
419 | 419 | |
420 | 420 | $constraints = $driver->query($query, [ |
421 | 421 | $tableOID, |
422 | - '(' . $column->name . '%', |
|
423 | - '("' . $column->name . '%', |
|
422 | + '('.$column->name.'%', |
|
423 | + '("'.$column->name.'%', |
|
424 | 424 | //Postgres magic |
425 | - $column->name . '::text%', |
|
426 | - '%(' . $column->name . ')::text%' |
|
425 | + $column->name.'::text%', |
|
426 | + '%('.$column->name.')::text%' |
|
427 | 427 | ]); |
428 | 428 | |
429 | 429 | foreach ($constraints as $constraint) { |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | */ |
454 | 454 | private static function resolveEnum(Driver $driver, PostgresColumn $column) |
455 | 455 | { |
456 | - $range = $driver->query('SELECT enum_range(NULL::' . $column->type . ')')->fetchColumn(0); |
|
456 | + $range = $driver->query('SELECT enum_range(NULL::'.$column->type.')')->fetchColumn(0); |
|
457 | 457 | |
458 | 458 | $column->enumValues = explode(',', substr($range, 1, -1)); |
459 | 459 |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @see Record::INDEXES |
99 | 99 | */ |
100 | - const INDEX = 1000; //Default index type |
|
101 | - const UNIQUE = 2000; //Unique index definition |
|
100 | + const INDEX = 1000; //Default index type |
|
101 | + const UNIQUE = 2000; //Unique index definition |
|
102 | 102 | |
103 | 103 | /* |
104 | 104 | * ================================================ |
@@ -302,11 +302,11 @@ discard block |
||
302 | 302 | $this->dispatch('insert', new RecordEvent($this, $command)); |
303 | 303 | |
304 | 304 | //Executed when transaction successfully completed |
305 | - $command->onComplete(function (InsertCommand $command) { |
|
305 | + $command->onComplete(function(InsertCommand $command) { |
|
306 | 306 | $this->handleInsert($command); |
307 | 307 | }); |
308 | 308 | |
309 | - $command->onRollBack(function () { |
|
309 | + $command->onRollBack(function() { |
|
310 | 310 | //Flushing existed insert command to prevent collisions |
311 | 311 | $this->lastInsert = null; |
312 | 312 | $this->state = ORMInterface::STATE_NEW; |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | ); |
330 | 330 | |
331 | 331 | if (!empty($this->lastInsert)) { |
332 | - $this->lastInsert->onExecute(function (InsertCommand $insert) use ($command) { |
|
332 | + $this->lastInsert->onExecute(function(InsertCommand $insert) use ($command) { |
|
333 | 333 | //Sync primary key values |
334 | 334 | $command->setWhere([$this->primaryColumn() => $insert->getInsertID()]); |
335 | 335 | $command->setPrimaryKey($insert->getInsertID()); |
@@ -341,11 +341,11 @@ discard block |
||
341 | 341 | $this->dispatch('update', new RecordEvent($this)); |
342 | 342 | |
343 | 343 | //Executed when transaction successfully completed |
344 | - $command->onComplete(function (UpdateCommand $command) { |
|
344 | + $command->onComplete(function(UpdateCommand $command) { |
|
345 | 345 | $this->handleUpdate($command); |
346 | 346 | }); |
347 | 347 | |
348 | - $command->onRollBack(function () { |
|
348 | + $command->onRollBack(function() { |
|
349 | 349 | //Flushing existed insert command to prevent collisions |
350 | 350 | $this->state = ORMInterface::STATE_LOADED; |
351 | 351 | }); |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | |
366 | 366 | if (!empty($this->lastInsert)) { |
367 | 367 | //Sync primary key values |
368 | - $this->lastInsert->onExecute(function (InsertCommand $insert) use ($command) { |
|
368 | + $this->lastInsert->onExecute(function(InsertCommand $insert) use ($command) { |
|
369 | 369 | $command->setWhere([$this->primaryColumn() => $insert->primaryKey()]); |
370 | 370 | }); |
371 | 371 | } |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | $this->dispatch('delete', new RecordEvent($this)); |
376 | 376 | |
377 | 377 | //Executed when transaction successfully completed |
378 | - $command->onComplete(function (DeleteCommand $command) { |
|
378 | + $command->onComplete(function(DeleteCommand $command) { |
|
379 | 379 | $this->handleDelete($command); |
380 | 380 | }); |
381 | 381 |