@@ -27,14 +27,10 @@ final class LazySession implements
27
27
SessionInterface,
28
28
InitializeSessionIdInterface
29
29
{
30
- /**
31
- * @var SessionPersistenceInterface
32
- */
30
+ /** @var SessionPersistenceInterface */
33
31
private $ persistence ;
34
32
35
- /**
36
- * @var null|SessionInterface
37
- */
33
+ /** @var null|SessionInterface */
38
34
private $ proxiedSession ;
39
35
40
36
/**
@@ -47,16 +43,16 @@ final class LazySession implements
47
43
public function __construct (SessionPersistenceInterface $ persistence , ServerRequestInterface $ request )
48
44
{
49
45
$ this ->persistence = $ persistence ;
50
- $ this ->request = $ request ;
46
+ $ this ->request = $ request ;
51
47
}
52
48
53
- public function regenerate () : SessionInterface
49
+ public function regenerate (): SessionInterface
54
50
{
55
51
$ this ->proxiedSession = $ this ->getProxiedSession ()->regenerate ();
56
52
return $ this ;
57
53
}
58
54
59
- public function isRegenerated () : bool
55
+ public function isRegenerated (): bool
60
56
{
61
57
if (! $ this ->proxiedSession ) {
62
58
return false ;
@@ -65,37 +61,44 @@ public function isRegenerated() : bool
65
61
return $ this ->proxiedSession ->isRegenerated ();
66
62
}
67
63
68
- public function toArray () : array
64
+ public function toArray (): array
69
65
{
70
66
return $ this ->getProxiedSession ()->toArray ();
71
67
}
72
68
69
+ /**
70
+ * @param null|mixed $default
71
+ * @return mixed
72
+ */
73
73
public function get (string $ name , $ default = null )
74
74
{
75
75
return $ this ->getProxiedSession ()->get ($ name , $ default );
76
76
}
77
77
78
- public function has (string $ name ) : bool
78
+ public function has (string $ name ): bool
79
79
{
80
80
return $ this ->getProxiedSession ()->has ($ name );
81
81
}
82
82
83
- public function set (string $ name , $ value ) : void
83
+ /**
84
+ * @param mixed $value
85
+ */
86
+ public function set (string $ name , $ value ): void
84
87
{
85
88
$ this ->getProxiedSession ()->set ($ name , $ value );
86
89
}
87
90
88
- public function unset (string $ name ) : void
91
+ public function unset (string $ name ): void
89
92
{
90
93
$ this ->getProxiedSession ()->unset ($ name );
91
94
}
92
95
93
- public function clear () : void
96
+ public function clear (): void
94
97
{
95
98
$ this ->getProxiedSession ()->clear ();
96
99
}
97
100
98
- public function hasChanged () : bool
101
+ public function hasChanged (): bool
99
102
{
100
103
if (! $ this ->proxiedSession ) {
101
104
return false ;
@@ -113,7 +116,7 @@ public function hasChanged() : bool
113
116
*
114
117
* @since 1.1.0
115
118
*/
116
- public function getId () : string
119
+ public function getId (): string
117
120
{
118
121
$ proxiedSession = $ this ->getProxiedSession ();
119
122
return $ proxiedSession instanceof SessionIdentifierAwareInterface
@@ -126,7 +129,7 @@ public function getId() : string
126
129
*
127
130
* @since 1.2.0
128
131
*/
129
- public function persistSessionFor (int $ duration ) : void
132
+ public function persistSessionFor (int $ duration ): void
130
133
{
131
134
$ proxiedSession = $ this ->getProxiedSession ();
132
135
if ($ proxiedSession instanceof SessionCookiePersistenceInterface) {
@@ -139,7 +142,7 @@ public function persistSessionFor(int $duration) : void
139
142
*
140
143
* @since 1.2.0
141
144
*/
142
- public function getSessionLifetime () : int
145
+ public function getSessionLifetime (): int
143
146
{
144
147
$ proxiedSession = $ this ->getProxiedSession ();
145
148
return $ proxiedSession instanceof SessionCookiePersistenceInterface
@@ -157,8 +160,7 @@ public function initializeId(): string
157
160
return $ this ->proxiedSession ->getId ();
158
161
}
159
162
160
-
161
- private function getProxiedSession () : SessionInterface
163
+ private function getProxiedSession (): SessionInterface
162
164
{
163
165
if ($ this ->proxiedSession ) {
164
166
return $ this ->proxiedSession ;
0 commit comments