Completed
Push — 6.0 ( 2acc4d...a1442b )
by yun
05:00
created
tests/DbTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
      */
23 23
     public function testConnect($config)
24 24
     {
25
-        $mysql = m::mock('overload:' . Mysql::class);
25
+        $mysql = m::mock('overload:'.Mysql::class);
26 26
 
27 27
         $db = new Db($config);
28 28
     }
Please login to merge, or discard this patch.
tests/AppTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -107,27 +107,27 @@  discard block
 block discarded – undo
107 107
 
108 108
     public function testPath()
109 109
     {
110
-        $rootPath = __DIR__ . DIRECTORY_SEPARATOR;
110
+        $rootPath = __DIR__.DIRECTORY_SEPARATOR;
111 111
 
112 112
         $app = new App($rootPath);
113 113
 
114 114
         $this->assertEquals($rootPath, $app->getRootPath());
115 115
 
116
-        $this->assertEquals(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR, $app->getThinkPath());
116
+        $this->assertEquals(dirname(__DIR__).DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR, $app->getThinkPath());
117 117
 
118
-        $this->assertEquals($rootPath . 'app' . DIRECTORY_SEPARATOR, $app->getAppPath());
118
+        $this->assertEquals($rootPath.'app'.DIRECTORY_SEPARATOR, $app->getAppPath());
119 119
 
120
-        $appPath = $rootPath . 'app' . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR;
120
+        $appPath = $rootPath.'app'.DIRECTORY_SEPARATOR.'admin'.DIRECTORY_SEPARATOR;
121 121
         $app->setAppPath($appPath);
122 122
         $this->assertEquals($appPath, $app->getAppPath());
123 123
 
124
-        $this->assertEquals($rootPath . 'app' . DIRECTORY_SEPARATOR, $app->getBasePath());
124
+        $this->assertEquals($rootPath.'app'.DIRECTORY_SEPARATOR, $app->getBasePath());
125 125
 
126
-        $this->assertEquals($rootPath . 'config' . DIRECTORY_SEPARATOR, $app->getConfigPath());
126
+        $this->assertEquals($rootPath.'config'.DIRECTORY_SEPARATOR, $app->getConfigPath());
127 127
 
128
-        $this->assertEquals($rootPath . 'runtime' . DIRECTORY_SEPARATOR, $app->getRuntimePath());
128
+        $this->assertEquals($rootPath.'runtime'.DIRECTORY_SEPARATOR, $app->getRuntimePath());
129 129
 
130
-        $runtimePath = $rootPath . 'runtime' . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR;
130
+        $runtimePath = $rootPath.'runtime'.DIRECTORY_SEPARATOR.'admin'.DIRECTORY_SEPARATOR;
131 131
         $app->setRuntimePath($runtimePath);
132 132
         $this->assertEquals($runtimePath, $app->getRuntimePath());
133 133
     }
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
      */
140 140
     protected function prepareAppForInitialize(vfsStreamDirectory $root, $debug = true)
141 141
     {
142
-        $rootPath = $root->url() . DIRECTORY_SEPARATOR;
142
+        $rootPath = $root->url().DIRECTORY_SEPARATOR;
143 143
 
144 144
         $app = new App($rootPath);
145 145
 
@@ -148,12 +148,12 @@  discard block
 block discarded – undo
148 148
 
149 149
         $app->instance($initializer->mockery_getName(), $initializer);
150 150
 
151
-        (function () use ($initializer) {
151
+        (function() use ($initializer) {
152 152
             $this->initializers = [$initializer->mockery_getName()];
153 153
         })->call($app);
154 154
 
155 155
         $env = m::mock(Env::class);
156
-        $env->shouldReceive('load')->once()->with($rootPath . '.env');
156
+        $env->shouldReceive('load')->once()->with($rootPath.'.env');
157 157
         $env->shouldReceive('get')->once()->with('config_ext', '.php')->andReturn('.php');
158 158
         $env->shouldReceive('get')->once()->with('app_debug')->andReturn($debug);
159 159
 
Please login to merge, or discard this patch.
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.