@@ -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 |
@@ -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 |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | |
128 | 128 | if (!$hideHeader && !empty($name)) { |
129 | 129 | //Showing element name (if any provided) |
130 | - $header = $indent . $this->style->apply($name, 'name'); |
|
130 | + $header = $indent.$this->style->apply($name, 'name'); |
|
131 | 131 | |
132 | 132 | //Showing equal sing |
133 | 133 | $header .= $this->style->apply(' = ', 'syntax', '='); |
@@ -137,24 +137,24 @@ discard block |
||
137 | 137 | |
138 | 138 | if ($level > $this->maxLevel) { |
139 | 139 | //Dumper is not reference based, we can't dump too deep values |
140 | - return $indent . $this->style->apply('-too deep-', 'maxLevel') . "\n"; |
|
140 | + return $indent.$this->style->apply('-too deep-', 'maxLevel')."\n"; |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | $type = strtolower(gettype($value)); |
144 | 144 | |
145 | 145 | if ($type == 'array') { |
146 | - return $header . $this->dumpArray($value, $level, $hideHeader); |
|
146 | + return $header.$this->dumpArray($value, $level, $hideHeader); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | if ($type == 'object') { |
150 | - return $header . $this->dumpObject($value, $level, $hideHeader); |
|
150 | + return $header.$this->dumpObject($value, $level, $hideHeader); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | if ($type == 'resource') { |
154 | 154 | //No need to dump resource value |
155 | - $element = get_resource_type($value) . ' resource '; |
|
155 | + $element = get_resource_type($value).' resource '; |
|
156 | 156 | |
157 | - return $header . $this->style->apply($element, 'type', 'resource') . "\n"; |
|
157 | + return $header.$this->style->apply($element, 'type', 'resource')."\n"; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | //Value length |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | } |
182 | 182 | |
183 | 183 | //Including value |
184 | - return $header . ' ' . $this->style->apply($element, 'value', $type) . "\n"; |
|
184 | + return $header.' '.$this->style->apply($element, 'value', $type)."\n"; |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
@@ -199,8 +199,8 @@ discard block |
||
199 | 199 | $count = count($array); |
200 | 200 | |
201 | 201 | //Array size and scope |
202 | - $output = $this->style->apply("array({$count})", 'type', 'array') . "\n"; |
|
203 | - $output .= $indent . $this->style->apply('[', 'syntax', '[') . "\n"; |
|
202 | + $output = $this->style->apply("array({$count})", 'type', 'array')."\n"; |
|
203 | + $output .= $indent.$this->style->apply('[', 'syntax', '[')."\n"; |
|
204 | 204 | } else { |
205 | 205 | $output = ''; |
206 | 206 | } |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | |
220 | 220 | if (!$hideHeader) { |
221 | 221 | //Closing array scope |
222 | - $output .= $indent . $this->style->apply(']', 'syntax', ']') . "\n"; |
|
222 | + $output .= $indent.$this->style->apply(']', 'syntax', ']')."\n"; |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | return $output; |
@@ -242,10 +242,10 @@ discard block |
||
242 | 242 | $indent = $this->style->indent($level); |
243 | 243 | |
244 | 244 | if (!$hideHeader) { |
245 | - $type = ($class ?: get_class($object)) . ' object '; |
|
245 | + $type = ($class ?: get_class($object)).' object '; |
|
246 | 246 | |
247 | - $header = $this->style->apply($type, 'type', 'object') . "\n"; |
|
248 | - $header .= $indent . $this->style->apply('(', 'syntax', '(') . "\n"; |
|
247 | + $header = $this->style->apply($type, 'type', 'object')."\n"; |
|
248 | + $header .= $indent.$this->style->apply('(', 'syntax', '(')."\n"; |
|
249 | 249 | } else { |
250 | 250 | $header = ''; |
251 | 251 | } |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | |
271 | 271 | return $header |
272 | 272 | . $this->dumpValue($debugInfo, '', $level + (is_scalar($object)), true) |
273 | - . $indent . $this->style->apply(')', 'syntax', ')') . "\n"; |
|
273 | + . $indent.$this->style->apply(')', 'syntax', ')')."\n"; |
|
274 | 274 | } |
275 | 275 | |
276 | 276 | $refection = new \ReflectionObject($object); |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | } |
282 | 282 | |
283 | 283 | //Header, content, footer |
284 | - return $header . $output . $indent . $this->style->apply(')', 'syntax', ')') . "\n"; |
|
284 | + return $header.$output.$indent.$this->style->apply(')', 'syntax', ')')."\n"; |
|
285 | 285 | } |
286 | 286 | |
287 | 287 | /** |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | $name = $this->style->apply($property->getName(), 'dynamic'); |
317 | 317 | } else { |
318 | 318 | //Property name includes access level |
319 | - $name = $property->getName() . $this->style->apply(':' . $access, 'access', $access); |
|
319 | + $name = $property->getName().$this->style->apply(':'.$access, 'access', $access); |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | return $this->dumpValue($property->getValue($object), $name, $level + 1); |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | $reflection = new \ReflectionFunction($closure); |
335 | 335 | |
336 | 336 | return [ |
337 | - 'name' => $reflection->getName() . " (lines {$reflection->getStartLine()}:{$reflection->getEndLine()})", |
|
337 | + 'name' => $reflection->getName()." (lines {$reflection->getStartLine()}:{$reflection->getEndLine()})", |
|
338 | 338 | 'file' => $reflection->getFileName(), |
339 | 339 | 'this' => $reflection->getClosureThis() |
340 | 340 | ]; |
@@ -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 |
@@ -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 |
@@ -375,7 +375,7 @@ |
||
375 | 375 | * Execute statement. |
376 | 376 | * |
377 | 377 | * @param string $statement |
378 | - * @param array $parameters |
|
378 | + * @param string[] $parameters |
|
379 | 379 | * |
380 | 380 | * @return \PDOStatement |
381 | 381 | * |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | if (!empty($table->getPrimaryKeys())) { |
331 | 331 | $primaryKeys = array_map([$this, 'identify'], $table->getPrimaryKeys()); |
332 | 332 | |
333 | - $innerStatement[] = 'PRIMARY KEY (' . join(', ', $primaryKeys) . ')'; |
|
333 | + $innerStatement[] = 'PRIMARY KEY ('.join(', ', $primaryKeys).')'; |
|
334 | 334 | } |
335 | 335 | |
336 | 336 | //Constraints and foreign keys |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | $innerStatement[] = $reference->sqlStatement($this->driver); |
339 | 339 | } |
340 | 340 | |
341 | - $statement[] = " " . join(",\n ", $innerStatement); |
|
341 | + $statement[] = " ".join(",\n ", $innerStatement); |
|
342 | 342 | $statement[] = ')'; |
343 | 343 | |
344 | 344 | return join("\n", $statement); |
@@ -18,10 +18,10 @@ |
||
18 | 18 | /** |
19 | 19 | * Argument types. |
20 | 20 | */ |
21 | - const CONSTANT = 'constant'; //Scalar constant and not variable. |
|
22 | - const VARIABLE = 'variable'; //PHP variable |
|
21 | + const CONSTANT = 'constant'; //Scalar constant and not variable. |
|
22 | + const VARIABLE = 'variable'; //PHP variable |
|
23 | 23 | const EXPRESSION = 'expression'; //PHP code (expression). |
24 | - const STRING = 'string'; //Simple scalar string, can be fetched using stringValue(). |
|
24 | + const STRING = 'string'; //Simple scalar string, can be fetched using stringValue(). |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * @var string |
@@ -88,7 +88,7 @@ |
||
88 | 88 | */ |
89 | 89 | protected function classReflection(string $class): \ReflectionClass |
90 | 90 | { |
91 | - $loader = function ($class) { |
|
91 | + $loader = function($class) { |
|
92 | 92 | throw new LocatorException("Class '{$class}' can not be loaded"); |
93 | 93 | }; |
94 | 94 |