1616 * Class FakeManager
1717 */
1818class FakeManager implements ICommentsManager {
19- public function get ($ id ) {
19+ public function get ($ id ): IComment {
20+ throw new \Exception ('Not implemented ' );
2021 }
2122
22- public function getTree ($ id , $ limit = 0 , $ offset = 0 ) {
23+ public function getTree ($ id , $ limit = 0 , $ offset = 0 ): array {
24+ return ['comment ' => new Comment (), 'replies ' => []];
2325 }
2426
2527 public function getForObject (
@@ -28,7 +30,8 @@ public function getForObject(
2830 $ limit = 0 ,
2931 $ offset = 0 ,
3032 ?\DateTime $ notOlderThan = null ,
31- ) {
33+ ): array {
34+ return [];
3235 }
3336
3437 public function getForObjectSince (
@@ -57,6 +60,7 @@ public function getCommentsWithVerbForObjectSinceComment(
5760 }
5861
5962 public function getNumberOfCommentsForObject ($ objectType , $ objectId , ?\DateTime $ notOlderThan = null , $ verb = '' ): int {
63+ return 0 ;
6064 }
6165
6266 public function getNumberOfCommentsForObjects (string $ objectType , array $ objectIds , ?\DateTime $ notOlderThan = null , string $ verb = '' ): array {
@@ -67,10 +71,12 @@ public function search(string $search, string $objectType, string $objectId, str
6771 return [];
6872 }
6973
70- public function create ($ actorType , $ actorId , $ objectType , $ objectId ) {
74+ public function create ($ actorType , $ actorId , $ objectType , $ objectId ): IComment {
75+ return new Comment ();
7176 }
7277
73- public function delete ($ id ) {
78+ public function delete ($ id ): bool {
79+ return false ;
7480 }
7581
7682 public function getReactionComment (int $ parentId , string $ actorType , string $ actorId , string $ reaction ): IComment {
@@ -89,47 +95,52 @@ public function supportReactions(): bool {
8995 return false ;
9096 }
9197
92- public function save (IComment $ comment ) {
98+ public function save (IComment $ comment ): bool {
99+ return false ;
93100 }
94101
95- public function deleteReferencesOfActor ($ actorType , $ actorId ) {
102+ public function deleteReferencesOfActor ($ actorType , $ actorId ): bool {
103+ return false ;
96104 }
97105
98- public function deleteCommentsAtObject ($ objectType , $ objectId ) {
106+ public function deleteCommentsAtObject ($ objectType , $ objectId ): bool {
107+ return false ;
99108 }
100109
101- public function setReadMark ($ objectType , $ objectId , \DateTime $ dateTime , IUser $ user ) {
110+ public function setReadMark ($ objectType , $ objectId , \DateTime $ dateTime , IUser $ user ): bool {
111+ return false ;
102112 }
103113
104- public function getReadMark ($ objectType , $ objectId , IUser $ user ) {
114+ public function getReadMark ($ objectType , $ objectId , IUser $ user ): bool {
115+ return false ;
105116 }
106117
107- public function deleteReadMarksFromUser (IUser $ user ) {
118+ public function deleteReadMarksFromUser (IUser $ user ): bool {
119+ return false ;
108120 }
109121
110- public function deleteReadMarksOnObject ($ objectType , $ objectId ) {
122+ public function deleteReadMarksOnObject ($ objectType , $ objectId ): bool {
123+ return false ;
111124 }
112125
113- public function registerEventHandler (\Closure $ closure ) {
126+ public function registerEventHandler (\Closure $ closure ): void {
114127 }
115128
116- public function registerDisplayNameResolver ($ type , \Closure $ closure ) {
129+ public function registerDisplayNameResolver ($ type , \Closure $ closure ): void {
117130 }
118131
119- public function resolveDisplayName ($ type , $ id ) {
132+ public function resolveDisplayName ($ type , $ id ): string {
133+ return '' ;
120134 }
121135
122- public function getNumberOfUnreadCommentsForFolder ($ folderId , IUser $ user ) {
136+ public function getNumberOfUnreadCommentsForFolder ($ folderId , IUser $ user ): array {
137+ return [];
123138 }
124139
125140 public function getNumberOfUnreadCommentsForObjects (string $ objectType , array $ objectIds , IUser $ user , $ verb = '' ): array {
126141 return [];
127142 }
128143
129-
130- public function getActorsInTree ($ id ) {
131- }
132-
133144 public function load (): void {
134145 }
135146
0 commit comments