1 | <?php |
||
34 | class CryptoSessionData implements \ArrayAccess, ISession { |
||
35 | /** @var ISession */ |
||
36 | protected $session; |
||
37 | /** @var \OCP\Security\ICrypto */ |
||
38 | protected $crypto; |
||
39 | /** @var string */ |
||
40 | protected $passphrase; |
||
41 | /** @var array */ |
||
42 | protected $sessionValues; |
||
43 | /** @var bool */ |
||
44 | protected $isModified = false; |
||
45 | CONST encryptedSessionName = 'encrypted_session_data'; |
||
46 | |||
47 | /** |
||
48 | * @param ISession $session |
||
49 | * @param ICrypto $crypto |
||
50 | * @param string $passphrase |
||
51 | */ |
||
52 | public function __construct(ISession $session, |
||
60 | |||
61 | /** |
||
62 | * Close session if class gets destructed |
||
63 | */ |
||
64 | public function __destruct() { |
||
67 | |||
68 | protected function initializeSession() { |
||
79 | |||
80 | /** |
||
81 | * Set a value in the session |
||
82 | * |
||
83 | * @param string $key |
||
84 | * @param mixed $value |
||
85 | */ |
||
86 | public function set($key, $value) { |
||
90 | |||
91 | /** |
||
92 | * Get a value from the session |
||
93 | * |
||
94 | * @param string $key |
||
95 | * @return string|null Either the value or null |
||
96 | */ |
||
97 | public function get($key) { |
||
104 | |||
105 | /** |
||
106 | * Check if a named key exists in the session |
||
107 | * |
||
108 | * @param string $key |
||
109 | * @return bool |
||
110 | */ |
||
111 | public function exists($key) { |
||
114 | |||
115 | /** |
||
116 | * Remove a $key/$value pair from the session |
||
117 | * |
||
118 | * @param string $key |
||
119 | */ |
||
120 | public function remove($key) { |
||
125 | |||
126 | /** |
||
127 | * Reset and recreate the session |
||
128 | */ |
||
129 | public function clear() { |
||
134 | |||
135 | /** |
||
136 | * Wrapper around session_regenerate_id |
||
137 | * |
||
138 | * @param bool $deleteOldSession Whether to delete the old associated session file or not. |
||
139 | * @return void |
||
140 | */ |
||
141 | public function regenerateId($deleteOldSession = true) { |
||
144 | |||
145 | /** |
||
146 | * Wrapper around session_id |
||
147 | * |
||
148 | * @return string |
||
149 | * @throws SessionNotAvailableException |
||
150 | * @since 9.1.0 |
||
151 | */ |
||
152 | public function getId() { |
||
155 | |||
156 | /** |
||
157 | * Close the session and release the lock, also writes all changed data in batch |
||
158 | */ |
||
159 | public function close() { |
||
167 | |||
168 | /** |
||
169 | * @param mixed $offset |
||
170 | * @return bool |
||
171 | */ |
||
172 | public function offsetExists($offset) { |
||
175 | |||
176 | /** |
||
177 | * @param mixed $offset |
||
178 | * @return mixed |
||
179 | */ |
||
180 | public function offsetGet($offset) { |
||
183 | |||
184 | /** |
||
185 | * @param mixed $offset |
||
186 | * @param mixed $value |
||
187 | */ |
||
188 | public function offsetSet($offset, $value) { |
||
191 | |||
192 | /** |
||
193 | * @param mixed $offset |
||
194 | */ |
||
195 | public function offsetUnset($offset) { |
||
198 | } |
||
199 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..