From fb8d54ef72532e3b9d13612d32d7d1658420a106 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Mon, 13 Jun 2022 11:37:48 +0200 Subject: Fix undefined when no tags Signed-off-by: Daniel Kesselberg --- core/Command/SystemTag/ListCommand.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core') 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(), -- cgit v1.2.3