summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2022-06-13 11:37:48 +0200
committerDaniel Kesselberg <mail@danielkesselberg.de>2022-06-28 15:44:08 +0200
commitfb8d54ef72532e3b9d13612d32d7d1658420a106 (patch)
tree6275191c180f7aadcc8619e5d8154d107f42eee6 /core
parenta1bc7700439c6f06842d42e67a0474de9faef34d (diff)
downloadnextcloud-server-fb8d54ef72532e3b9d13612d32d7d1658420a106.tar.gz
nextcloud-server-fb8d54ef72532e3b9d13612d32d7d1658420a106.zip
Fix undefined when no tags
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'core')
-rw-r--r--core/Command/SystemTag/ListCommand.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/Command/SystemTag/ListCommand.php b/core/Command/SystemTag/ListCommand.php
index 06c39b4977a..7993eb87891 100644
--- a/core/Command/SystemTag/ListCommand.php
+++ b/core/Command/SystemTag/ListCommand.php
@@ -23,8 +23,8 @@
namespace OC\Core\Command\SystemTag;
use OC\Core\Command\Base;
-use OCP\SystemTag\ISystemTagManager;
use OCP\SystemTag\ISystemTag;
+use OCP\SystemTag\ISystemTagManager;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
@@ -70,7 +70,9 @@ class ListCommand extends Base {
* @param ISystemtag[] $tags
* @return array
*/
- private function formatTags(array $tags) {
+ private function formatTags(array $tags): array {
+ $result = [];
+
foreach ($tags as $tag) {
$result[$tag->getId()] = [
'name' => $tag->getName(),