File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -42,24 +42,17 @@ class TagService {
4242 private $ userSession ;
4343 /** @var IManager */
4444 private $ activityManager ;
45- /** @var ITags */
45+ /** @var ITags|null */
4646 private $ tagger ;
4747 /** @var Folder */
4848 private $ homeFolder ;
4949 /** @var EventDispatcherInterface */
5050 private $ dispatcher ;
5151
52- /**
53- * @param IUserSession $userSession
54- * @param IManager $activityManager
55- * @param ITags $tagger
56- * @param Folder $homeFolder
57- * @param EventDispatcherInterface $dispatcher
58- */
5952 public function __construct (
6053 IUserSession $ userSession ,
6154 IManager $ activityManager ,
62- ITags $ tagger ,
55+ ? ITags $ tagger ,
6356 Folder $ homeFolder ,
6457 EventDispatcherInterface $ dispatcher
6558 ) {
@@ -81,6 +74,10 @@ public function __construct(
8174 * @throws \OCP\Files\NotFoundException if the file does not exist
8275 */
8376 public function updateFileTags ($ path , $ tags ) {
77+ if ($ this ->tagger === null ) {
78+ throw new \RuntimeException ('No tagger set ' );
79+ }
80+
8481 $ fileId = $ this ->homeFolder ->get ($ path )->getId ();
8582
8683 $ currentTags = $ this ->tagger ->getTagsForObjects ([$ fileId ]);
You can’t perform that action at this time.
0 commit comments