Completed
Pull Request — master (#11)
by Joao
04:29
created
webtest/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 </div>
16 16
 
17 17
 <div>
18
-    <textarea cols="50" rows="20"><?php print_r($_SESSION);?>
18
+    <textarea cols="50" rows="20"><?php print_r($_SESSION); ?>
19 19
     </textarea>
20 20
 </div>
21 21
 
Please login to merge, or discard this patch.
tests/JwtSessionTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -66,19 +66,19 @@  discard block
 block discarded – undo
66 66
             ],
67 67
             [
68 68
                 [
69
-                    "text" => [ 1, 2, 3 ]
69
+                    "text" => [1, 2, 3]
70 70
                 ],
71 71
                 "text|a:3:{i:0;i:1;i:1;i:2;i:2;i:3;}"
72 72
             ],
73 73
             [
74 74
                 [
75
-                    "text" => [ "a" => 1, "b" => 2, "c" => 3 ]
75
+                    "text" => ["a" => 1, "b" => 2, "c" => 3]
76 76
                 ],
77 77
                 "text|a:3:{s:1:\"a\";i:1;s:1:\"b\";i:2;s:1:\"c\";i:3;}"
78 78
             ],
79 79
             [
80 80
                 [
81
-                    "text" => [ "a" => 1, "b" => 2, "c" => 3 ],
81
+                    "text" => ["a" => 1, "b" => 2, "c" => 3],
82 82
                     "single" => 2000
83 83
                 ],
84 84
                 "text|a:3:{s:1:\"a\";i:1;s:1:\"b\";i:2;s:1:\"c\";i:3;}single|i:2000;"
@@ -91,13 +91,13 @@  discard block
 block discarded – undo
91 91
             ],
92 92
             [
93 93
                 [
94
-                    "text" => [ "a" => $obj ]
94
+                    "text" => ["a" => $obj]
95 95
                 ],
96 96
                 "text|a:1:{s:1:\"a\";O:8:\"stdClass\":2:{s:5:\"prop1\";s:6:\"value1\";s:5:\"prop2\";s:6:\"value2\";}}"
97 97
             ],
98 98
             [
99 99
                 [
100
-                    "text" => [ $obj ]
100
+                    "text" => [$obj]
101 101
                 ],
102 102
                 "text|a:1:{i:0;O:8:\"stdClass\":2:{s:5:\"prop1\";s:6:\"value1\";s:5:\"prop2\";s:6:\"value2\";}}"
103 103
             ]
Please login to merge, or discard this patch.
src/JwtSession.php 2 patches
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     /**
18 18
      * JwtSession constructor.
19 19
      *
20
-     * @param $sessionConfig
20
+     * @param SessionConfig $sessionConfig
21 21
      * @throws JwtSessionException
22 22
      */
23 23
     public function __construct($sessionConfig)
@@ -36,7 +36,6 @@  discard block
 block discarded – undo
36 36
     }
37 37
 
38 38
     /**
39
-     * @param bool $startSession
40 39
      * @throws JwtSessionException
41 40
      */
42 41
     protected function replaceSessionHandler()
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             setcookie(
86 86
                 self::COOKIE_PREFIX . $this->sessionConfig->getSessionContext(),
87 87
                 null,
88
-                (time()-3000),
88
+                (time() - 3000),
89 89
                 $this->sessionConfig->getCookiePath(),
90 90
                 $this->sessionConfig->getCookieDomain()
91 91
             );
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
             setcookie(
197 197
                 self::COOKIE_PREFIX . $this->sessionConfig->getSessionContext(),
198 198
                 $token,
199
-                (time()+$this->sessionConfig->getTimeoutMinutes()*60) ,
199
+                (time() + $this->sessionConfig->getTimeoutMinutes() * 60),
200 200
                 $this->sessionConfig->getCookiePath(),
201 201
                 $this->sessionConfig->getCookieDomain(),
202 202
                 false,
Please login to merge, or discard this patch.
src/SessionConfig.php 1 patch
Doc Comments   +10 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
     /**
21 21
      * SessionConfig constructor.
22
-     * @param $serverName
22
+     * @param string $serverName
23 23
      */
24 24
     public function __construct($serverName)
25 25
     {
@@ -47,11 +47,18 @@  discard block
 block discarded – undo
47 47
         return $this;
48 48
     }
49 49
 
50
+    /**
51
+     * @param string $secret
52
+     */
50 53
     public function withSecret($secret) {
51 54
         $this->jwtKey = new JwtKeySecret($secret);
52 55
         return $this;
53 56
     }
54 57
     
58
+    /**
59
+     * @param string $private
60
+     * @param string $public
61
+     */
55 62
     public function withRsaSecret($private, $public) {
56 63
         $this->jwtKey = new JwtRsaKey($private, $public);
57 64
         return $this;
@@ -63,7 +70,7 @@  discard block
 block discarded – undo
63 70
     }
64 71
 
65 72
     /**
66
-     * @return mixed
73
+     * @return string
67 74
      */
68 75
     public function getServerName()
69 76
     {
@@ -87,7 +94,7 @@  discard block
 block discarded – undo
87 94
     }
88 95
 
89 96
     /**
90
-     * @return null
97
+     * @return string|null
91 98
      */
92 99
     public function getCookieDomain()
93 100
     {
Please login to merge, or discard this patch.