aboutsummaryrefslogtreecommitdiffstats
path: root/apps/encryption/lib/Session.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/encryption/lib/Session.php')
-rw-r--r--apps/encryption/lib/Session.php37
1 files changed, 8 insertions, 29 deletions
diff --git a/apps/encryption/lib/Session.php b/apps/encryption/lib/Session.php
index ad07008d480..df1e5d664ad 100644
--- a/apps/encryption/lib/Session.php
+++ b/apps/encryption/lib/Session.php
@@ -1,28 +1,9 @@
<?php
+
/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Bjoern Schiessle <bjoern@schiessle.org>
- * @author Björn Schießle <bjoern@schiessle.org>
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Clark Tomlinson <fallen013@gmail.com>
- * @author Lukas Reschke <lukas@statuscode.ch>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
*/
namespace OCA\Encryption;
@@ -31,9 +12,6 @@ use OCP\ISession;
class Session {
- /** @var ISession */
- protected $session;
-
public const NOT_INITIALIZED = '0';
public const INIT_EXECUTED = '1';
public const INIT_SUCCESSFUL = '2';
@@ -41,8 +19,9 @@ class Session {
/**
* @param ISession $session
*/
- public function __construct(ISession $session) {
- $this->session = $session;
+ public function __construct(
+ protected ISession $session,
+ ) {
}
/**
@@ -87,7 +66,7 @@ class Session {
public function getPrivateKey() {
$key = $this->session->get('privateKey');
if (is_null($key)) {
- throw new Exceptions\PrivateKeyMissingException('please try to log-out and log-in again', 0);
+ throw new PrivateKeyMissingException('please try to log-out and log-in again');
}
return $key;
}