summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-06-29 15:11:50 +0200
committerGitHub <noreply@github.com>2022-06-29 15:11:50 +0200
commit477dae9e1192203f460ae63e6744779fb813defd (patch)
treed7a27c346d8cfffbc78239c9b32fbb1973370be0 /core
parent1952d6e9b4d9a955ba2f93e797541833bcc6b18a (diff)
parentfb8d54ef72532e3b9d13612d32d7d1658420a106 (diff)
downloadnextcloud-server-477dae9e1192203f460ae63e6744779fb813defd.tar.gz
nextcloud-server-477dae9e1192203f460ae63e6744779fb813defd.zip
Merge pull request #32857 from nextcloud/debt/noid/result-may-undefined
Fix undefined when no tags
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(),