Code Duplication    Length = 5-5 lines in 2 locations

service/notesservice.php 2 locations

@@ 44-48 (lines=5) @@
41
            $filesById[$note->getId()] = $note;
42
        }
43
        $tagger = \OC::$server->getTagManager()->load('files');
44
        if($tagger==null) {
45
            $tags = [];
46
        } else {
47
            $tags = $tagger->getTagsForObjects(array_keys($filesById));
48
        }
49
        $notes = [];
50
        foreach($filesById as $id=>$file) {
51
            $notes[] = Note::fromFile($file, array_key_exists($id, $tags) ? $tags[$id] : []);
@@ 68-72 (lines=5) @@
65
    }
66
    private function getTags ($id) {
67
        $tagger = \OC::$server->getTagManager()->load('files');
68
        if($tagger==null) {
69
            $tags = [];
70
        } else {
71
            $tags = $tagger->getTagsForObjects([$id]);
72
        }
73
        return array_key_exists($id, $tags) ? $tags[$id] : [];
74
    }
75
    /**