File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -96,9 +96,9 @@ public function prepare(array $likes)
9696
9797 foreach ($ likeData as $ objectTypeID => $ likes ) {
9898 $ objectType = CommentHandler::getInstance ()->getObjectType ($ objectTypeID );
99- if ( CommentHandler::getInstance ()->getCommentManager ($ objectType ->objectType ) instanceof IViewableLikeProvider) {
100- /** @noinspection PhpUndefinedMethodInspection */
101- CommentHandler:: getInstance ()-> getCommentManager ( $ objectType -> objectType ) ->prepare ($ likes );
99+ $ commentManager = CommentHandler::getInstance ()->getCommentManager ($ objectType ->objectType );
100+ if ( $ commentManager instanceof IViewableLikeProvider) {
101+ $ commentManager ->prepare ($ likes );
102102 }
103103 }
104104 }
@@ -114,7 +114,9 @@ public function getObjectsByIDs(array $objectIDs)
114114 {
115115 return \array_map (
116116 static fn (CommentResponse $ comment ) => new LikeableCommentResponse ($ comment ),
117- CommentResponseRuntimeCache::getInstance ()->getObjects ($ objectIDs )
117+ \array_filter (
118+ CommentResponseRuntimeCache::getInstance ()->getObjects ($ objectIDs ),
119+ )
118120 );
119121 }
120122}
You can’t perform that action at this time.
0 commit comments