Completed
Push — master ( b13107...84196b )
by Anton
04:37
created
source/Spiral/Database/Entities/QueryCompiler.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
     {
321 321
         $statement = '';
322 322
         foreach ($joinTokens as $table => $join) {
323
-            $statement .= "\n" . $join['type'] . ' JOIN ' . $this->quote($table, true);
323
+            $statement .= "\n".$join['type'].' JOIN '.$this->quote($table, true);
324 324
             $statement .= $this->optional("\n    ON", $this->compileWhere($join['on']));
325 325
         }
326 326
 
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
                 throw new CompilerException("Invalid sorting direction, only ASC and DESC are allowed");
373 373
             }
374 374
 
375
-            $result[] = $this->quote($order[0]) . ' ' . $direction;
375
+            $result[] = $this->quote($order[0]).' '.$direction;
376 376
         }
377 377
 
378 378
         return implode(', ', $result);
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
             $prefix .= ' ';
539 539
         }
540 540
 
541
-        return $prefix . $expression . $postfix;
541
+        return $prefix.$expression.$postfix;
542 542
     }
543 543
 
544 544
     /**
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
     {
598 598
         if ($context instanceof QueryBuilder) {
599 599
             //Nested queries has to be wrapped with braces
600
-            return '(' . $context->sqlStatement($this) . ')';
600
+            return '('.$context->sqlStatement($this).')';
601 601
         }
602 602
 
603 603
         if ($context instanceof ExpressionInterface) {
Please login to merge, or discard this patch.
source/Spiral/ORM/EntityMap.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,10 +62,10 @@  discard block
 block discarded – undo
62 62
         }
63 63
 
64 64
         if (empty($entity->primaryKey())) {
65
-            throw new MapException("Unable to store non identified entity " . get_class($entity));
65
+            throw new MapException("Unable to store non identified entity ".get_class($entity));
66 66
         }
67 67
 
68
-        $cacheID = get_class($entity) . ':' . $entity->primaryKey();
68
+        $cacheID = get_class($entity).':'.$entity->primaryKey();
69 69
 
70 70
         return $this->entities[$cacheID] = $entity;
71 71
     }
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     public function forget(RecordInterface $entity)
79 79
     {
80
-        $cacheID = get_class($entity) . ':' . $entity->primaryKey();
80
+        $cacheID = get_class($entity).':'.$entity->primaryKey();
81 81
         unset($this->entities[$cacheID]);
82 82
     }
83 83
 
Please login to merge, or discard this patch.
source/Spiral/ORM/Schemas/SchemaLocator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
 
61 61
             $schemas[] = $this->container->get(FactoryInterface::class)->make(
62 62
                 RecordSchema::class,
63
-                ['reflection' => new ReflectionEntity($class['name']),]
63
+                ['reflection' => new ReflectionEntity($class['name']), ]
64 64
             );
65 65
         }
66 66
 
Please login to merge, or discard this patch.
source/Spiral/ODM/Schemas/SchemaLocator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
 
59 59
             $schemas[] = $this->container->get(FactoryInterface::class)->make(
60 60
                 DocumentSchema::class,
61
-                ['reflection' => new ReflectionEntity($class['name']),]
61
+                ['reflection' => new ReflectionEntity($class['name']), ]
62 62
             );
63 63
         }
64 64
 
Please login to merge, or discard this patch.
source/Spiral/Storage/Servers/RackspaceServer.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -85,11 +85,11 @@  discard block
 block discarded – undo
85 85
 
86 86
         if (!empty($this->cache) && $this->options['cache']) {
87 87
             $this->authToken = $this->cache->get(
88
-                $this->options['username'] . '@rackspace-token'
88
+                $this->options['username'].'@rackspace-token'
89 89
             );
90 90
 
91 91
             $this->regions = (array)$this->cache->get(
92
-                $this->options['username'] . '@rackspace-regions'
92
+                $this->options['username'].'@rackspace-regions'
93 93
             );
94 94
         }
95 95
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     public function exists(
120 120
         BucketInterface $bucket,
121 121
         string $name,
122
-        ResponseInterface &$response = null
122
+        ResponseInterface & $response = null
123 123
     ): bool {
124 124
         try {
125 125
             $response = $this->client->send($this->buildRequest('HEAD', $bucket, $name));
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
     {
245 245
         try {
246 246
             $request = $this->buildRequest('PUT', $bucket, $newName, [
247
-                'X-Copy-From'    => '/' . $bucket->getOption('container') . '/' . rawurlencode($oldName),
247
+                'X-Copy-From'    => '/'.$bucket->getOption('container').'/'.rawurlencode($oldName),
248 248
                 'Content-Length' => 0
249 249
             ]);
250 250
 
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 
282 282
         try {
283 283
             $request = $this->buildRequest('PUT', $destination, $name, [
284
-                'X-Copy-From'    => '/' . $bucket->getOption('container') . '/' . rawurlencode($name),
284
+                'X-Copy-From'    => '/'.$bucket->getOption('container').'/'.rawurlencode($name),
285 285
                 'Content-Length' => 0
286 286
             ]);
287 287
 
@@ -357,13 +357,13 @@  discard block
 block discarded – undo
357 357
 
358 358
         if (!empty($this->cache) && $this->options['cache']) {
359 359
             $this->cache->set(
360
-                $username . '@rackspace-token',
360
+                $username.'@rackspace-token',
361 361
                 $this->authToken,
362 362
                 $this->options['lifetime']
363 363
             );
364 364
 
365 365
             $this->cache->set(
366
-                $username . '@rackspace-regions',
366
+                $username.'@rackspace-regions',
367 367
                 $this->regions,
368 368
                 $this->options['lifetime']
369 369
             );
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
         }
403 403
 
404 404
         return new Uri(
405
-            $this->regions[$region] . '/' . $bucket->getOption('container') . '/' . rawurlencode($name)
405
+            $this->regions[$region].'/'.$bucket->getOption('container').'/'.rawurlencode($name)
406 406
         );
407 407
     }
408 408
 
Please login to merge, or discard this patch.
source/Spiral/ORM/Entities/Nodes/PivotedRootNode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,6 +106,6 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
source/Spiral/ORM/Entities/Relations/BelongsToRelation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
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)
Please login to merge, or discard this patch.
source/Spiral/Debug/Dumper.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         ];
Please login to merge, or discard this patch.
source/Spiral/ORM/Entities/Relations/ManyToManyRelation.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.