From 7abb4c30441a2d22916a99138ff7c6eab207f34e 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 f9d17efd513..2dc68a05670 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; @@ -72,7 +72,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