diff options
Diffstat (limited to 'lib/private/Share20/ShareAttributes.php')
-rw-r--r-- | lib/private/Share20/ShareAttributes.php | 41 |
1 files changed, 14 insertions, 27 deletions
diff --git a/lib/private/Share20/ShareAttributes.php b/lib/private/Share20/ShareAttributes.php index 9b97c94275d..f90fbd9c6cd 100644 --- a/lib/private/Share20/ShareAttributes.php +++ b/lib/private/Share20/ShareAttributes.php @@ -1,22 +1,9 @@ <?php + /** - * @author Piotr Mrowczynski <piotr@owncloud.com> - * - * @copyright Copyright (c) 2019, ownCloud GmbH - * @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: 2023-2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-FileCopyrightText: 2019-2022 ownCloud GmbH + * SPDX-License-Identifier: AGPL-3.0-only */ namespace OC\Share20; @@ -33,20 +20,20 @@ class ShareAttributes implements IAttributes { /** * @inheritdoc */ - public function setAttribute($scope, $key, $enabled) { + public function setAttribute(string $scope, string $key, mixed $value): IAttributes { if (!\array_key_exists($scope, $this->attributes)) { $this->attributes[$scope] = []; } - $this->attributes[$scope][$key] = $enabled; + $this->attributes[$scope][$key] = $value; return $this; } /** * @inheritdoc */ - public function getAttribute($scope, $key) { - if (\array_key_exists($scope, $this->attributes) && - \array_key_exists($key, $this->attributes[$scope])) { + public function getAttribute(string $scope, string $key): mixed { + if (\array_key_exists($scope, $this->attributes) + && \array_key_exists($key, $this->attributes[$scope])) { return $this->attributes[$scope][$key]; } return null; @@ -55,14 +42,14 @@ class ShareAttributes implements IAttributes { /** * @inheritdoc */ - public function toArray() { + public function toArray(): array { $result = []; foreach ($this->attributes as $scope => $keys) { - foreach ($keys as $key => $enabled) { + foreach ($keys as $key => $value) { $result[] = [ - "scope" => $scope, - "key" => $key, - "enabled" => $enabled + 'scope' => $scope, + 'key' => $key, + 'value' => $value, ]; } } |