Completed
Push — 6.0 ( 482461...384317 )
by liu
05:47
created
tests/HttpTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
         $route = m::mock(Route::class);
50 50
 
51
-        $route->shouldReceive('dispatch')->withArgs(function ($req, $withRoute) use ($request) {
51
+        $route->shouldReceive('dispatch')->withArgs(function($req, $withRoute) use ($request) {
52 52
             if ($withRoute) {
53 53
                 $withRoute();
54 54
             }
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
 
81 81
         $this->http->multi(false);
82 82
 
83
-        $this->app->shouldReceive('getBasePath')->andReturn($root->getChild('app')->url() . DIRECTORY_SEPARATOR);
84
-        $this->app->shouldReceive('getRootPath')->andReturn($root->url() . DIRECTORY_SEPARATOR);
83
+        $this->app->shouldReceive('getBasePath')->andReturn($root->getChild('app')->url().DIRECTORY_SEPARATOR);
84
+        $this->app->shouldReceive('getRootPath')->andReturn($root->url().DIRECTORY_SEPARATOR);
85 85
 
86 86
         $request  = m::mock(Request::class)->makePartial();
87 87
         $response = m::mock(Response::class)->makePartial();
@@ -140,9 +140,9 @@  discard block
 block discarded – undo
140 140
 
141 141
         $this->app->shouldReceive('get')->with('config')->andReturn($config);
142 142
 
143
-        $this->app->shouldReceive('getBasePath')->andReturn($root->getChild('app')->url() . DIRECTORY_SEPARATOR);
144
-        $this->app->shouldReceive('getRootPath')->andReturn($root->url() . DIRECTORY_SEPARATOR);
145
-        $this->app->shouldReceive('getConfigPath')->andReturn($root->getChild('config')->url() . DIRECTORY_SEPARATOR);
143
+        $this->app->shouldReceive('getBasePath')->andReturn($root->getChild('app')->url().DIRECTORY_SEPARATOR);
144
+        $this->app->shouldReceive('getRootPath')->andReturn($root->url().DIRECTORY_SEPARATOR);
145
+        $this->app->shouldReceive('getConfigPath')->andReturn($root->getChild('config')->url().DIRECTORY_SEPARATOR);
146 146
 
147 147
         $response = m::mock(Response::class)->makePartial();
148 148
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
             $this->assertTrue($this->http->isBindDomain());
175 175
         }
176 176
         if ($path) {
177
-            $this->assertEquals(rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR, $this->app->getAppPath());
177
+            $this->assertEquals(rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR, $this->app->getAppPath());
178 178
         }
179 179
     }
180 180
 
Please login to merge, or discard this patch.
tests/ContainerTest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
         Container::setInstance($container);
59 59
 
60
-        $container->bind('name', function () {
60
+        $container->bind('name', function() {
61 61
             return 'Taylor';
62 62
         });
63 63
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $this->expectExceptionMessage('class not exists: name');
75 75
         $container->get('name');
76 76
 
77
-        $container->bind('name', function () {
77
+        $container->bind('name', function() {
78 78
             return 'Taylor';
79 79
         });
80 80
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     {
86 86
         $container = new Container;
87 87
 
88
-        $container->bind('name', function () {
88
+        $container->bind('name', function() {
89 89
             return 'Taylor';
90 90
         });
91 91
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
     {
101 101
         $container = new Container;
102 102
 
103
-        $container->bind('name', function () {
103
+        $container->bind('name', function() {
104 104
             return 'Taylor';
105 105
         });
106 106
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 
193 193
         $this->assertSame($object, Container::getInstance());
194 194
 
195
-        Container::setInstance(function () {
195
+        Container::setInstance(function() {
196 196
             return $this;
197 197
         });
198 198
 
@@ -221,17 +221,17 @@  discard block
 block discarded – undo
221 221
 
222 222
         $container->invokeMethod([$stub, 'some']);
223 223
 
224
-        $this->assertSame($container, $container->invokeMethod(Taylor::class . '::static'));
224
+        $this->assertSame($container, $container->invokeMethod(Taylor::class.'::static'));
225 225
 
226 226
         $reflect = new ReflectionMethod($container, 'exists');
227 227
 
228 228
         $this->assertTrue($container->invokeReflectMethod($container, $reflect, [Container::class]));
229 229
 
230
-        $this->assertSame($container, $container->invoke(function (Container $container) {
230
+        $this->assertSame($container, $container->invoke(function(Container $container) {
231 231
             return $container;
232 232
         }));
233 233
 
234
-        $this->assertSame($container, $container->invoke(Taylor::class . '::static'));
234
+        $this->assertSame($container, $container->invoke(Taylor::class.'::static'));
235 235
 
236 236
         $object = $container->invokeClass(SomeClass::class);
237 237
         $this->assertInstanceOf(SomeClass::class, $object);
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 
240 240
         $stdClass = new stdClass();
241 241
 
242
-        $container->invoke(function (Container $container, stdClass $stdObject, $key1, $lowKey, $key2 = 'default') use ($stdClass) {
242
+        $container->invoke(function(Container $container, stdClass $stdObject, $key1, $lowKey, $key2 = 'default') use ($stdClass) {
243 243
             $this->assertEquals('value1', $key1);
244 244
             $this->assertEquals('default', $key2);
245 245
             $this->assertEquals('value2', $lowKey);
Please login to merge, or discard this patch.
src/think/middleware/FormTokenCheck.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 // +----------------------------------------------------------------------
9 9
 // | Author: liu21st <[email protected]>
10 10
 // +----------------------------------------------------------------------
11
-declare (strict_types = 1);
11
+declare(strict_types=1);
12 12
 
13 13
 namespace think\middleware;
14 14
 
Please login to merge, or discard this patch.
src/think/middleware/AllowCrossDomain.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 // +----------------------------------------------------------------------
9 9
 // | Author: liu21st <[email protected]>
10 10
 // +----------------------------------------------------------------------
11
-declare (strict_types = 1);
11
+declare(strict_types=1);
12 12
 
13 13
 namespace think\middleware;
14 14
 
Please login to merge, or discard this patch.
src/think/contract/SessionHandlerInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 // +----------------------------------------------------------------------
9 9
 // | Author: liu21st <[email protected]>
10 10
 // +----------------------------------------------------------------------
11
-declare (strict_types = 1);
11
+declare(strict_types=1);
12 12
 
13 13
 namespace think\contract;
14 14
 
Please login to merge, or discard this patch.
src/think/contract/TemplateHandlerInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 // +----------------------------------------------------------------------
9 9
 // | Author: liu21st <[email protected]>
10 10
 // +----------------------------------------------------------------------
11
-declare (strict_types = 1);
11
+declare(strict_types=1);
12 12
 
13 13
 namespace think\contract;
14 14
 
Please login to merge, or discard this patch.
src/think/db/builder/Mysql.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 // +----------------------------------------------------------------------
9 9
 // | Author: liu21st <[email protected]>
10 10
 // +----------------------------------------------------------------------
11
-declare (strict_types = 1);
11
+declare(strict_types=1);
12 12
 
13 13
 namespace think\db\builder;
14 14
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 
123 123
         $set = [];
124 124
         foreach ($data as $key => $val) {
125
-            $set[] = $key . ' = ' . $val;
125
+            $set[] = $key.' = '.$val;
126 126
         }
127 127
 
128 128
         return str_replace(
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         foreach ($dataSet as $data) {
168 168
             $data = $this->parseData($query, $data, $allowFields, $bind);
169 169
 
170
-            $values[] = '( ' . implode(',', array_values($data)) . ' )';
170
+            $values[] = '( '.implode(',', array_values($data)).' )';
171 171
 
172 172
             if (!isset($insertFields)) {
173 173
                 $insertFields = array_keys($data);
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
         }
211 211
         $set = [];
212 212
         foreach ($data as $key => $val) {
213
-            $set[] = $key . ' = ' . $val;
213
+            $set[] = $key.' = '.$val;
214 214
         }
215 215
 
216 216
         return str_replace(
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
                 $this->parseTable($query, $options['table']),
247 247
                 $this->parsePartition($query, $options['partition']),
248 248
                 $this->parseExtra($query, $options['extra']),
249
-                !empty($options['using']) ? ' USING ' . $this->parseTable($query, $options['using']) . ' ' : '',
249
+                !empty($options['using']) ? ' USING '.$this->parseTable($query, $options['using']).' ' : '',
250 250
                 $this->parseJoin($query, $options['join']),
251 251
                 $this->parseWhere($query, $options['where']),
252 252
                 $this->parseOrder($query, $options['order']),
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
             $value = $value->getValue();
274 274
         }
275 275
 
276
-        return $key . ' ' . $exp . ' ' . $value;
276
+        return $key.' '.$exp.' '.$value;
277 277
     }
278 278
 
279 279
     /**
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
             $value = $value->getValue();
293 293
         }
294 294
 
295
-        return 'FIND_IN_SET(' . $value . ', ' . $key . ')';
295
+        return 'FIND_IN_SET('.$value.', '.$key.')';
296 296
     }
297 297
 
298 298
     /**
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
         if (strpos($key, '->') && false === strpos($key, '(')) {
317 317
             // JSON字段支持
318 318
             list($field, $name) = explode('->', $key, 2);
319
-            return 'json_extract(' . $this->parseKey($query, $field) . ', \'$' . (strpos($name, '[') === 0 ? '' : '.') . str_replace('->', '.', $name) . '\')';
319
+            return 'json_extract('.$this->parseKey($query, $field).', \'$'.(strpos($name, '[') === 0 ? '' : '.').str_replace('->', '.', $name).'\')';
320 320
         } elseif (strpos($key, '.') && !preg_match('/[,\'\"\(\)`\s]/', $key)) {
321 321
             list($table, $key) = explode('.', $key, 2);
322 322
 
@@ -333,11 +333,11 @@  discard block
 block discarded – undo
333 333
         }
334 334
 
335 335
         if ($strict && !preg_match('/^[\w\.\*]+$/', $key)) {
336
-            throw new Exception('not support data:' . $key);
336
+            throw new Exception('not support data:'.$key);
337 337
         }
338 338
 
339 339
         if ('*' != $key && !preg_match('/[,\'\"\*\(\)`.\s]/', $key)) {
340
-            $key = '`' . $key . '`';
340
+            $key = '`'.$key.'`';
341 341
         }
342 342
 
343 343
         if (isset($table)) {
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
                 $table = str_replace('.', '`.`', $table);
346 346
             }
347 347
 
348
-            $key = '`' . $table . '`.' . $key;
348
+            $key = '`'.$table.'`.'.$key;
349 349
         }
350 350
 
351 351
         return $key;
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
             $partition = explode(',', $partition);
380 380
         }
381 381
 
382
-        return ' PARTITION (' . implode(' , ', $partition) . ') ';
382
+        return ' PARTITION ('.implode(' , ', $partition).') ';
383 383
     }
384 384
 
385 385
     /**
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
         }
397 397
 
398 398
         if ($duplicate instanceof Raw) {
399
-            return ' ON DUPLICATE KEY UPDATE ' . $duplicate->getValue() . ' ';
399
+            return ' ON DUPLICATE KEY UPDATE '.$duplicate->getValue().' ';
400 400
         }
401 401
 
402 402
         if (is_string($duplicate)) {
@@ -407,15 +407,15 @@  discard block
 block discarded – undo
407 407
         foreach ($duplicate as $key => $val) {
408 408
             if (is_numeric($key)) {
409 409
                 $val       = $this->parseKey($query, $val);
410
-                $updates[] = $val . ' = VALUES(' . $val . ')';
410
+                $updates[] = $val.' = VALUES('.$val.')';
411 411
             } elseif ($val instanceof Raw) {
412
-                $updates[] = $this->parseKey($query, $key) . " = " . $val->getValue();
412
+                $updates[] = $this->parseKey($query, $key)." = ".$val->getValue();
413 413
             } else {
414 414
                 $name      = $query->bindValue($val, $query->getConnection()->getFieldBindType($key));
415
-                $updates[] = $this->parseKey($query, $key) . " = :" . $name;
415
+                $updates[] = $this->parseKey($query, $key)." = :".$name;
416 416
             }
417 417
         }
418 418
 
419
-        return ' ON DUPLICATE KEY UPDATE ' . implode(' , ', $updates) . ' ';
419
+        return ' ON DUPLICATE KEY UPDATE '.implode(' , ', $updates).' ';
420 420
     }
421 421
 }
Please login to merge, or discard this patch.
src/think/db/BaseQuery.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 // +----------------------------------------------------------------------
9 9
 // | Author: liu21st <[email protected]>
10 10
 // +----------------------------------------------------------------------
11
-declare (strict_types = 1);
11
+declare(strict_types=1);
12 12
 
13 13
 namespace think\db;
14 14
 
@@ -129,15 +129,15 @@  discard block
 block discarded – undo
129 129
             $name = App::parseName(substr($method, 5));
130 130
             array_unshift($args, $name);
131 131
             return call_user_func_array([$this, 'where'], $args);
132
-        } elseif ($this->model && method_exists($this->model, 'scope' . $method)) {
132
+        } elseif ($this->model && method_exists($this->model, 'scope'.$method)) {
133 133
             // 动态调用命名范围
134
-            $method = 'scope' . $method;
134
+            $method = 'scope'.$method;
135 135
             array_unshift($args, $this);
136 136
 
137 137
             call_user_func_array([$this->model, $method], $args);
138 138
             return $this;
139 139
         } else {
140
-            throw new Exception('method not exist:' . static::class . '->' . $method);
140
+            throw new Exception('method not exist:'.static::class.'->'.$method);
141 141
         }
142 142
     }
143 143
 
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 
212 212
         $name = $name ?: $this->name;
213 213
 
214
-        return $this->prefix . App::parseName($name);
214
+        return $this->prefix.App::parseName($name);
215 215
     }
216 216
 
217 217
     /**
@@ -436,10 +436,10 @@  discard block
 block discarded – undo
436 436
         $prefix = $prefix ?: $tableName;
437 437
         foreach ($field as $key => &$val) {
438 438
             if (is_numeric($key) && $alias) {
439
-                $field[$prefix . '.' . $val] = $alias . $val;
439
+                $field[$prefix.'.'.$val] = $alias.$val;
440 440
                 unset($field[$key]);
441 441
             } elseif (is_numeric($key)) {
442
-                $val = $prefix . '.' . $val;
442
+                $val = $prefix.'.'.$val;
443 443
             }
444 444
         }
445 445
 
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
             // 延迟写入
494 494
             $condition = $this->options['where'] ?? [];
495 495
 
496
-            $guid = md5($this->getTable() . '_' . $field . '_' . serialize($condition));
496
+            $guid = md5($this->getTable().'_'.$field.'_'.serialize($condition));
497 497
             $step = $this->connection->lazyWrite($op, $guid, $step, $lazyTime);
498 498
 
499 499
             if (false === $step) {
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
      */
562 562
     public function limit(int $offset, int $length = null)
563 563
     {
564
-        $this->options['limit'] = $offset . ($length ? ',' . $length : '');
564
+        $this->options['limit'] = $offset.($length ? ','.$length : '');
565 565
 
566 566
         return $this;
567 567
     }
@@ -745,7 +745,7 @@  discard block
 block discarded – undo
745 745
 
746 746
         if (is_string($field)) {
747 747
             if (!empty($this->options['via'])) {
748
-                $field = $this->options['via'] . '.' . $field;
748
+                $field = $this->options['via'].'.'.$field;
749 749
             }
750 750
             if (strpos($field, ',')) {
751 751
                 $field = array_map('trim', explode(',', $field));
@@ -755,9 +755,9 @@  discard block
 block discarded – undo
755 755
         } elseif (!empty($this->options['via'])) {
756 756
             foreach ($field as $key => $val) {
757 757
                 if (is_numeric($key)) {
758
-                    $field[$key] = $this->options['via'] . '.' . $val;
758
+                    $field[$key] = $this->options['via'].'.'.$val;
759 759
                 } else {
760
-                    $field[$this->options['via'] . '.' . $key] = $val;
760
+                    $field[$this->options['via'].'.'.$key] = $val;
761 761
                     unset($field[$key]);
762 762
                 }
763 763
             }
@@ -1427,7 +1427,7 @@  discard block
 block discarded – undo
1427 1427
      */
1428 1428
     public function buildSql(bool $sub = true): string
1429 1429
     {
1430
-        return $sub ? '( ' . $this->fetchSql()->select() . ' )' : $this->fetchSql()->select();
1430
+        return $sub ? '( '.$this->fetchSql()->select().' )' : $this->fetchSql()->select();
1431 1431
     }
1432 1432
 
1433 1433
     /**
@@ -1483,7 +1483,7 @@  discard block
 block discarded – undo
1483 1483
             $page                  = $page > 0 ? $page : 1;
1484 1484
             $listRows              = $listRows ?: (is_numeric($options['limit']) ? $options['limit'] : 20);
1485 1485
             $offset                = $listRows * ($page - 1);
1486
-            $options['limit']      = $offset . ',' . $listRows;
1486
+            $options['limit']      = $offset.','.$listRows;
1487 1487
         }
1488 1488
 
1489 1489
         $this->options = $options;
Please login to merge, or discard this patch.
src/think/db/concern/JoinAndViewQuery.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 // +----------------------------------------------------------------------
9 9
 // | Author: liu21st <[email protected]>
10 10
 // +----------------------------------------------------------------------
11
-declare (strict_types = 1);
11
+declare(strict_types=1);
12 12
 
13 13
 namespace think\db\concern;
14 14
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
         $table  = $this->getJoinTable($join, $alias);
202 202
 
203 203
         if (true === $field) {
204
-            $fields = $alias . '.*';
204
+            $fields = $alias.'.*';
205 205
         } else {
206 206
             if (is_string($field)) {
207 207
                 $field = explode(',', $field);
@@ -209,17 +209,17 @@  discard block
 block discarded – undo
209 209
 
210 210
             foreach ($field as $key => $val) {
211 211
                 if (is_numeric($key)) {
212
-                    $fields[] = $alias . '.' . $val;
212
+                    $fields[] = $alias.'.'.$val;
213 213
 
214
-                    $this->options['map'][$val] = $alias . '.' . $val;
214
+                    $this->options['map'][$val] = $alias.'.'.$val;
215 215
                 } else {
216 216
                     if (preg_match('/[,=\.\'\"\(\s]/', $key)) {
217 217
                         $name = $key;
218 218
                     } else {
219
-                        $name = $alias . '.' . $key;
219
+                        $name = $alias.'.'.$key;
220 220
                     }
221 221
 
222
-                    $fields[] = $name . ' AS ' . $val;
222
+                    $fields[] = $name.' AS '.$val;
223 223
 
224 224
                     $this->options['map'][$val] = $name;
225 225
                 }
Please login to merge, or discard this patch.