aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Tagging/Tag.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Tagging/Tag.php')
-rw-r--r--lib/private/Tagging/Tag.php44
1 files changed, 16 insertions, 28 deletions
diff --git a/lib/private/Tagging/Tag.php b/lib/private/Tagging/Tag.php
index 17af385418d..55a3a410281 100644
--- a/lib/private/Tagging/Tag.php
+++ b/lib/private/Tagging/Tag.php
@@ -1,25 +1,9 @@
<?php
+
/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Bernhard Reiter <ockham@raz.or.at>
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @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 OC\Tagging;
@@ -61,14 +45,16 @@ class Tag extends Entity {
* @todo migrate existing database columns to the correct names
* to be able to drop this direct mapping
*/
- public function columnToProperty($columnName) {
+ public function columnToProperty(string $columnName): string {
if ($columnName === 'category') {
return 'name';
- } elseif ($columnName === 'uid') {
+ }
+
+ if ($columnName === 'uid') {
return 'owner';
- } else {
- return parent::columnToProperty($columnName);
}
+
+ return parent::columnToProperty($columnName);
}
/**
@@ -77,13 +63,15 @@ class Tag extends Entity {
* @param string $property the name of the property
* @return string the column name
*/
- public function propertyToColumn($property) {
+ public function propertyToColumn(string $property): string {
if ($property === 'name') {
return 'category';
- } elseif ($property === 'owner') {
+ }
+
+ if ($property === 'owner') {
return 'uid';
- } else {
- return parent::propertyToColumn($property);
}
+
+ return parent::propertyToColumn($property);
}
}