Merge pull request #32857 from nextcloud/debt/noid/result-may-undefined

Fix  undefined when no tags
This commit is contained in:
Carl Schwan 2022-06-29 15:11:50 +02:00 committed by GitHub
commit 477dae9e11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(),