Completed
Push — 6.0 ( b72c2e...58dbb9 )
by yun
05:58
created
tests/SessionTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,11 +43,11 @@
 block discarded – undo
43 43
         $this->config = m::mock(Config::class)->makePartial();
44 44
 
45 45
         $this->app->shouldReceive('get')->with('config')->andReturn($this->config);
46
-        $handlerClass = "\\think\\session\\driver\\Test" . Str::random(10);
46
+        $handlerClass = "\\think\\session\\driver\\Test".Str::random(10);
47 47
         $this->config->shouldReceive("get")->with("session.type", "file")->andReturn($handlerClass);
48 48
         $this->session = new Session($this->app);
49 49
 
50
-        $this->handler = m::mock('overload:' . $handlerClass, SessionHandlerInterface::class);
50
+        $this->handler = m::mock('overload:'.$handlerClass, SessionHandlerInterface::class);
51 51
     }
52 52
 
53 53
     public function testLoadData()
Please login to merge, or discard this patch.
src/think/session/Store.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@
 block discarded – undo
116 116
      */
117 117
     public function setId($id = null): void
118 118
     {
119
-        $this->id = is_string($id) ? $id : md5(microtime(true) . uniqid());
119
+        $this->id = is_string($id) ? $id : md5(microtime(true).uniqid());
120 120
     }
121 121
 
122 122
     /**
Please login to merge, or discard this patch.
src/think/session/driver/File.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\session\driver;
14 14
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $this->config = array_merge($this->config, $config);
40 40
 
41 41
         if (empty($this->config['path'])) {
42
-            $this->config['path'] = $app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . 'session' . DIRECTORY_SEPARATOR;
42
+            $this->config['path'] = $app->getRootPath().'runtime'.DIRECTORY_SEPARATOR.'session'.DIRECTORY_SEPARATOR;
43 43
         } elseif (substr($this->config['path'], -1) != DIRECTORY_SEPARATOR) {
44 44
             $this->config['path'] .= DIRECTORY_SEPARATOR;
45 45
         }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         $lifetime = $this->config['expire'];
77 77
         $now      = time();
78 78
 
79
-        $files = $this->findFiles($this->config['path'], function (SplFileInfo $item) use ($lifetime, $now) {
79
+        $files = $this->findFiles($this->config['path'], function(SplFileInfo $item) use ($lifetime, $now) {
80 80
             return $now > $item->getMTime() + $lifetime;
81 81
         });
82 82
 
@@ -118,12 +118,12 @@  discard block
 block discarded – undo
118 118
     {
119 119
         if ($this->config['prefix']) {
120 120
             // 使用子目录
121
-            $name = $this->config['prefix'] . DIRECTORY_SEPARATOR . 'sess_' . $name;
121
+            $name = $this->config['prefix'].DIRECTORY_SEPARATOR.'sess_'.$name;
122 122
         } else {
123
-            $name = 'sess_' . $name;
123
+            $name = 'sess_'.$name;
124 124
         }
125 125
 
126
-        $filename = $this->config['path'] . $name;
126
+        $filename = $this->config['path'].$name;
127 127
         $dir      = dirname($filename);
128 128
 
129 129
         if ($auto && !is_dir($dir)) {
Please login to merge, or discard this patch.
src/think/session/driver/Cache.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,16 +35,16 @@
 block discarded – undo
35 35
 
36 36
     public function read(string $sessionId): string
37 37
     {
38
-        return (string) $this->handler->get($this->prefix . $sessionId);
38
+        return (string) $this->handler->get($this->prefix.$sessionId);
39 39
     }
40 40
 
41 41
     public function delete(string $sessionId): bool
42 42
     {
43
-        return $this->handler->delete($this->prefix . $sessionId);
43
+        return $this->handler->delete($this->prefix.$sessionId);
44 44
     }
45 45
 
46 46
     public function write(string $sessionId, string $data): bool
47 47
     {
48
-        return $this->handler->set($this->prefix . $sessionId, $data, $this->expire);
48
+        return $this->handler->set($this->prefix.$sessionId, $data, $this->expire);
49 49
     }
50 50
 }
Please login to merge, or discard this patch.
src/think/Session.php 1 patch
Spacing   +2 added lines, -2 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;
14 14
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     public function getConfig(string $name = null, $default = null)
42 42
     {
43 43
         if (!is_null($name)) {
44
-            return $this->app->config->get('session.' . $name, $default);
44
+            return $this->app->config->get('session.'.$name, $default);
45 45
         }
46 46
 
47 47
         return $this->app->config->get('session');
Please login to merge, or discard this patch.