@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | } |
284 | 284 | |
285 | 285 | //Syncing pivot data values |
286 | - $command->onComplete(function (ContextualCommandInterface $command) use ($record) { |
|
286 | + $command->onComplete(function(ContextualCommandInterface $command) use ($record) { |
|
287 | 287 | //Now when we are done we can sync our values with current data |
288 | 288 | $this->pivotData->offsetSet( |
289 | 289 | $record, |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | ContextualCommandInterface $outerCommand |
331 | 331 | ) { |
332 | 332 | //Parent record dependency |
333 | - $parentCommand->onExecute(function ($parentCommand) use ($pivotCommand, $parent) { |
|
333 | + $parentCommand->onExecute(function($parentCommand) use ($pivotCommand, $parent) { |
|
334 | 334 | $pivotCommand->addContext( |
335 | 335 | $this->key(Record::THOUGHT_INNER_KEY), |
336 | 336 | $this->lookupKey(Record::INNER_KEY, $parent, $parentCommand) |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | }); |
339 | 339 | |
340 | 340 | //Outer record dependency |
341 | - $outerCommand->onExecute(function ($outerCommand) use ($pivotCommand, $outer) { |
|
341 | + $outerCommand->onExecute(function($outerCommand) use ($pivotCommand, $outer) { |
|
342 | 342 | $pivotCommand->addContext( |
343 | 343 | $this->key(Record::THOUGHT_OUTER_KEY), |
344 | 344 | $this->lookupKey(Record::OUTER_KEY, $outer, $outerCommand) |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | $loader, |
405 | 405 | [ |
406 | 406 | 'alias' => $table->getName(), |
407 | - 'pivotAlias' => $table->getName() . '_pivot', |
|
407 | + 'pivotAlias' => $table->getName().'_pivot', |
|
408 | 408 | 'method' => RelationLoader::POSTLOAD |
409 | 409 | ] |
410 | 410 | ); |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | $query = $loader->configureQuery($query, [$innerKey]); |
415 | 415 | |
416 | 416 | //Additional pivot conditions |
417 | - $pivotDecorator = new WhereDecorator($query, 'onWhere', $table->getName() . '_pivot'); |
|
417 | + $pivotDecorator = new WhereDecorator($query, 'onWhere', $table->getName().'_pivot'); |
|
418 | 418 | $pivotDecorator->where($this->schema[Record::WHERE_PIVOT]); |
419 | 419 | |
420 | 420 | //Additional where conditions! |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | { |
480 | 480 | if ($diff = array_diff(array_keys($pivotData), $this->schema[Record::PIVOT_COLUMNS])) { |
481 | 481 | throw new RelationException( |
482 | - "Invalid pivot data, undefined columns found: " . join(', ', $diff) |
|
482 | + "Invalid pivot data, undefined columns found: ".join(', ', $diff) |
|
483 | 483 | ); |
484 | 484 | } |
485 | 485 | } |
@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | protected function declareIndexes(Source $source, StateComparator $comparator) |
134 | 134 | { |
135 | 135 | foreach ($comparator->addedIndexes() as $index) { |
136 | - $columns = '[\'' . join('\', \'', $index->getColumns()) . '\']'; |
|
137 | - $source->addString(" ->addIndex({$columns}, " . $this->indexOptions($index) . ")"); |
|
136 | + $columns = '[\''.join('\', \'', $index->getColumns()).'\']'; |
|
137 | + $source->addString(" ->addIndex({$columns}, ".$this->indexOptions($index).")"); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | foreach ($comparator->alteredIndexes() as $pair) { |
@@ -143,12 +143,12 @@ discard block |
||
143 | 143 | */ |
144 | 144 | $index = $pair[self::NEW_STATE]; |
145 | 145 | |
146 | - $columns = '[\'' . join('\', \'', $index->getColumns()) . '\']'; |
|
147 | - $source->addString(" ->alterIndex({$columns}, " . $this->indexOptions($index) . ")"); |
|
146 | + $columns = '[\''.join('\', \'', $index->getColumns()).'\']'; |
|
147 | + $source->addString(" ->alterIndex({$columns}, ".$this->indexOptions($index).")"); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | foreach ($comparator->droppedIndexes() as $index) { |
151 | - $columns = '[\'' . join('\', \'', $index->getColumns()) . '\']'; |
|
151 | + $columns = '[\''.join('\', \'', $index->getColumns()).'\']'; |
|
152 | 152 | $source->addString(" ->dropIndex({$columns})"); |
153 | 153 | } |
154 | 154 | } |
@@ -165,11 +165,11 @@ discard block |
||
165 | 165 | ) { |
166 | 166 | foreach ($comparator->addedForeigns() as $foreign) { |
167 | 167 | $column = "'{$foreign->getColumn()}'"; |
168 | - $table = "'" . substr($foreign->getForeignTable(), strlen($prefix)) . "'"; |
|
168 | + $table = "'".substr($foreign->getForeignTable(), strlen($prefix))."'"; |
|
169 | 169 | $key = "'{$foreign->getForeignKey()}'"; |
170 | 170 | |
171 | 171 | $source->addString( |
172 | - " ->addForeignKey({$column}, {$table}, {$key}, " . $this->foreignOptions($foreign) . ")" |
|
172 | + " ->addForeignKey({$column}, {$table}, {$key}, ".$this->foreignOptions($foreign).")" |
|
173 | 173 | ); |
174 | 174 | } |
175 | 175 | |
@@ -180,11 +180,11 @@ discard block |
||
180 | 180 | $foreign = $pair[self::NEW_STATE]; |
181 | 181 | |
182 | 182 | $column = "'{$foreign->getColumn()}'"; |
183 | - $table = "'" . substr($foreign->getForeignTable(), strlen($prefix)) . "'"; |
|
183 | + $table = "'".substr($foreign->getForeignTable(), strlen($prefix))."'"; |
|
184 | 184 | $key = "'{$foreign->getForeignKey()}'"; |
185 | 185 | |
186 | 186 | $source->addString( |
187 | - " ->alterForeignKey({$column}, {$table}, {$key}, " . $this->foreignOptions($foreign) . ")" |
|
187 | + " ->alterForeignKey({$column}, {$table}, {$key}, ".$this->foreignOptions($foreign).")" |
|
188 | 188 | ); |
189 | 189 | } |
190 | 190 | |
@@ -230,8 +230,8 @@ discard block |
||
230 | 230 | protected function revertIndexes(Source $source, StateComparator $comparator) |
231 | 231 | { |
232 | 232 | foreach ($comparator->droppedIndexes() as $index) { |
233 | - $columns = '[\'' . join('\', \'', $index->getColumns()) . '\']'; |
|
234 | - $source->addString(" ->addIndex({$columns}, " . $this->indexOptions($index) . ")"); |
|
233 | + $columns = '[\''.join('\', \'', $index->getColumns()).'\']'; |
|
234 | + $source->addString(" ->addIndex({$columns}, ".$this->indexOptions($index).")"); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | foreach ($comparator->alteredIndexes() as $pair) { |
@@ -240,12 +240,12 @@ discard block |
||
240 | 240 | */ |
241 | 241 | $index = $pair[self::ORIGINAL_STATE]; |
242 | 242 | |
243 | - $columns = '[\'' . join('\', \'', $index->getColumns()) . '\']'; |
|
244 | - $source->addString(" ->alterIndex({$columns}, " . $this->indexOptions($index) . ")"); |
|
243 | + $columns = '[\''.join('\', \'', $index->getColumns()).'\']'; |
|
244 | + $source->addString(" ->alterIndex({$columns}, ".$this->indexOptions($index).")"); |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | foreach ($comparator->addedIndexes() as $index) { |
248 | - $columns = '[\'' . join('\', \'', $index->getColumns()) . '\']'; |
|
248 | + $columns = '[\''.join('\', \'', $index->getColumns()).'\']'; |
|
249 | 249 | $source->addString(" ->dropIndex({$columns})"); |
250 | 250 | } |
251 | 251 | } |
@@ -262,11 +262,11 @@ discard block |
||
262 | 262 | ) { |
263 | 263 | foreach ($comparator->droppedForeigns() as $foreign) { |
264 | 264 | $column = "'{$foreign->getColumn()}'"; |
265 | - $table = "'" . substr($foreign->getForeignTable(), strlen($prefix)) . "'"; |
|
265 | + $table = "'".substr($foreign->getForeignTable(), strlen($prefix))."'"; |
|
266 | 266 | $key = "'{$foreign->getForeignKey()}'"; |
267 | 267 | |
268 | 268 | $source->addString( |
269 | - " ->addForeignKey({$column}, {$table}, {$key}, " . $this->foreignOptions($foreign) . ")" |
|
269 | + " ->addForeignKey({$column}, {$table}, {$key}, ".$this->foreignOptions($foreign).")" |
|
270 | 270 | ); |
271 | 271 | } |
272 | 272 | |
@@ -277,11 +277,11 @@ discard block |
||
277 | 277 | $foreign = $pair[self::ORIGINAL_STATE]; |
278 | 278 | |
279 | 279 | $column = "'{$foreign->getColumn()}'"; |
280 | - $table = "'" . substr($foreign->getForeignTable(), strlen($prefix)) . "'"; |
|
280 | + $table = "'".substr($foreign->getForeignTable(), strlen($prefix))."'"; |
|
281 | 281 | $key = "'{$foreign->getForeignKey()}'"; |
282 | 282 | |
283 | 283 | $source->addString( |
284 | - " ->alterForeignKey({$column}, {$table}, {$key}, " . $this->foreignOptions($foreign) . ")" |
|
284 | + " ->alterForeignKey({$column}, {$table}, {$key}, ".$this->foreignOptions($foreign).")" |
|
285 | 285 | ); |
286 | 286 | } |
287 | 287 | |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | { |
360 | 360 | $lines = explode("\n", $serialized); |
361 | 361 | foreach ($lines as &$line) { |
362 | - $line = " " . $line; |
|
362 | + $line = " ".$line; |
|
363 | 363 | unset($line); |
364 | 364 | } |
365 | 365 |
@@ -22,7 +22,7 @@ |
||
22 | 22 | /** |
23 | 23 | * Set of allowed enum values. |
24 | 24 | */ |
25 | - const VALUES = []; |
|
25 | + const VALUES = []; |
|
26 | 26 | |
27 | 27 | /** |
28 | 28 | * Default value. |
@@ -79,7 +79,7 @@ |
||
79 | 79 | |
80 | 80 | if (!$this->isSynced($this->parent, $this->instance)) { |
81 | 81 | //Syncing FKs before primary command been executed |
82 | - $innerCommand->onExecute(function ($innerCommand) use ($parentCommand) { |
|
82 | + $innerCommand->onExecute(function($innerCommand) use ($parentCommand) { |
|
83 | 83 | $parentCommand->addContext( |
84 | 84 | $this->key(Record::INNER_KEY), |
85 | 85 | $this->lookupKey(Record::OUTER_KEY, $this->parent, $innerCommand) |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | |
175 | 175 | if (!$this->isSynced($this->parent, $instance)) { |
176 | 176 | //Delayed linking |
177 | - $parentCommand->onExecute(function ($outerCommand) use ($innerCommand) { |
|
177 | + $parentCommand->onExecute(function($outerCommand) use ($innerCommand) { |
|
178 | 178 | $innerCommand->addContext( |
179 | 179 | $this->key(Record::OUTER_KEY), |
180 | 180 | $this->lookupKey(Record::INNER_KEY, $this->parent, $outerCommand) |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | //Morph key |
233 | 233 | $decorator = new WhereDecorator($selector, 'where', $selector->getAlias()); |
234 | 234 | $decorator->where( |
235 | - '{@}.' . $this->key(Record::MORPH_KEY), |
|
235 | + '{@}.'.$this->key(Record::MORPH_KEY), |
|
236 | 236 | $this->orm->define(get_class($this->parent), ORMInterface::R_ROLE_NAME) |
237 | 237 | ); |
238 | 238 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | //Inversed version of BelongsTo |
90 | 90 | if (!$this->isSynced($this->parent, $this->instance)) { |
91 | 91 | //Syncing FKs after primary command been executed |
92 | - $parentCommand->onExecute(function ($outerCommand) use ($innerCommand) { |
|
92 | + $parentCommand->onExecute(function($outerCommand) use ($innerCommand) { |
|
93 | 93 | $innerCommand->addContext( |
94 | 94 | $this->key(Record::OUTER_KEY), |
95 | 95 | $this->lookupKey(Record::INNER_KEY, $this->parent, $outerCommand) |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | if (!empty($morphKey = $this->key(Record::MORPH_KEY))) { |
121 | 121 | //HasOne relation support additional morph key |
122 | - $where['{@}.' . $this->key(Record::MORPH_KEY)] = $this->orm->define( |
|
122 | + $where['{@}.'.$this->key(Record::MORPH_KEY)] = $this->orm->define( |
|
123 | 123 | get_class($this->parent), |
124 | 124 | ORMInterface::R_ROLE_NAME |
125 | 125 | ); |
@@ -78,12 +78,12 @@ discard block |
||
78 | 78 | if ($this->isJoined()) { |
79 | 79 | $query->join( |
80 | 80 | $this->getMethod() == self::JOIN ? 'INNER' : 'LEFT', |
81 | - $this->pivotTable() . ' AS ' . $this->pivotAlias(), |
|
81 | + $this->pivotTable().' AS '.$this->pivotAlias(), |
|
82 | 82 | [$this->pivotKey(Record::THOUGHT_INNER_KEY) => $this->parentKey(Record::INNER_KEY)] |
83 | 83 | ); |
84 | 84 | } else { |
85 | 85 | $query->innerJoin( |
86 | - $this->pivotTable() . ' AS ' . $this->pivotAlias(), |
|
86 | + $this->pivotTable().' AS '.$this->pivotAlias(), |
|
87 | 87 | [$this->pivotKey(Record::THOUGHT_OUTER_KEY) => $this->localKey(Record::OUTER_KEY)] |
88 | 88 | )->where( |
89 | 89 | $this->pivotKey(Record::THOUGHT_INNER_KEY), |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | //Actual data is always INNER join |
120 | 120 | $query->join( |
121 | 121 | $this->getMethod() == self::JOIN ? 'INNER' : 'LEFT', |
122 | - $this->getTable() . ' AS ' . $this->getAlias(), |
|
122 | + $this->getTable().' AS '.$this->getAlias(), |
|
123 | 123 | [$this->localKey(Record::OUTER_KEY) => $this->pivotKey(Record::THOUGHT_OUTER_KEY)] |
124 | 124 | ); |
125 | 125 | } |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | |
158 | 158 | if ($minify) { |
159 | 159 | //Let's use column number instead of full name |
160 | - $column = 'p_c' . count($columns); |
|
160 | + $column = 'p_c'.count($columns); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | $columns[] = "{$alias}.{$name} AS {$prefix}{$column}"; |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | return $this->options['pivotAlias']; |
207 | 207 | } |
208 | 208 | |
209 | - return $this->getAlias() . '_pivot'; |
|
209 | + return $this->getAlias().'_pivot'; |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | /** |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | return null; |
233 | 233 | } |
234 | 234 | |
235 | - return $this->pivotAlias() . '.' . $this->schema[$key]; |
|
235 | + return $this->pivotAlias().'.'.$this->schema[$key]; |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | /** |
@@ -84,11 +84,11 @@ |
||
84 | 84 | $reflection = new ReflectionFile( |
85 | 85 | $filename, |
86 | 86 | $this->normalizeTokens(token_get_all($this->files->read($filename))), |
87 | - (array)$this->memory->loadData(self::MEMORY . '.' . $fileMD5) |
|
87 | + (array)$this->memory->loadData(self::MEMORY.'.'.$fileMD5) |
|
88 | 88 | ); |
89 | 89 | |
90 | 90 | //Let's save to cache |
91 | - $this->memory->saveData(self::MEMORY . '.' . $fileMD5, $reflection->exportSchema()); |
|
91 | + $this->memory->saveData(self::MEMORY.'.'.$fileMD5, $reflection->exportSchema()); |
|
92 | 92 | |
93 | 93 | return $reflection; |
94 | 94 | } |
@@ -140,11 +140,11 @@ |
||
140 | 140 | * |
141 | 141 | * @return string |
142 | 142 | */ |
143 | - protected function createPlaceholder(string $name, string &$blockID = null): string |
|
143 | + protected function createPlaceholder(string $name, string & $blockID = null): string |
|
144 | 144 | { |
145 | - $blockID = $name . '-' . $this->supervisor->uniquePlaceholder(); |
|
145 | + $blockID = $name.'-'.$this->supervisor->uniquePlaceholder(); |
|
146 | 146 | |
147 | 147 | //Short block declaration syntax |
148 | - return '${' . $blockID . '}'; |
|
148 | + return '${'.$blockID.'}'; |
|
149 | 149 | } |
150 | 150 | } |
151 | 151 | \ No newline at end of file |