aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-11-25 11:19:47 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2023-06-20 10:55:20 +0200
commit9725d0032944ebe5a73d59781a66742c5d1ae404 (patch)
treed7f90b66e49297e276241ed3960716cddfbad49a /lib/public
parent5063bf37ed3e68041adb9a96f430a87d59106491 (diff)
downloadnextcloud-server-9725d0032944ebe5a73d59781a66742c5d1ae404.tar.gz
nextcloud-server-9725d0032944ebe5a73d59781a66742c5d1ae404.zip
Cleanup comments code
- Fix various psalm issues - Add as much typing as possible while preserving stable API Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/Comments/ICommentsManager.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/public/Comments/ICommentsManager.php b/lib/public/Comments/ICommentsManager.php
index a245e5d2f20..d3f78b4f2e3 100644
--- a/lib/public/Comments/ICommentsManager.php
+++ b/lib/public/Comments/ICommentsManager.php
@@ -36,6 +36,9 @@ use OCP\PreConditionNotMetException;
*
* This class manages the access to comments
*
+ * @psalm-type CommentNode = array{comment: IComment, replies: list<CommentNode>}
+ * @psalm-type CommentTree = list<CommentNode>
+ *
* @since 9.0.0
*/
interface ICommentsManager {
@@ -66,7 +69,6 @@ interface ICommentsManager {
* @param string $id
* @param int $limit max number of entries to return, 0 returns all
* @param int $offset the start entry
- * @return array
* @since 9.0.0
*
* The return array looks like this
@@ -110,7 +112,7 @@ interface ICommentsManager {
* @param int $offset optional, starting point
* @param \DateTime|null $notOlderThan optional, timestamp of the oldest comments
* that may be returned
- * @return IComment[]
+ * @return list<IComment>
* @since 9.0.0
*/
public function getForObject(
@@ -129,7 +131,7 @@ interface ICommentsManager {
* @param int $limit optional, number of maximum comments to be returned. if
* set to 0, all comments are returned.
* @param bool $includeLastKnown
- * @return IComment[]
+ * @return list<IComment>
* @since 14.0.0
* @deprecated 24.0.0 - Use getCommentsWithVerbForObjectSinceComment instead
*/
@@ -151,7 +153,7 @@ interface ICommentsManager {
* @param int $limit optional, number of maximum comments to be returned. if
* set to 0, all comments are returned.
* @param bool $includeLastKnown
- * @return IComment[]
+ * @return list<IComment>
* @since 24.0.0
*/
public function getCommentsWithVerbForObjectSinceComment(
@@ -173,7 +175,7 @@ interface ICommentsManager {
* @param string $verb Limit the verb of the comment
* @param int $offset
* @param int $limit
- * @return IComment[]
+ * @return list<IComment>
* @since 14.0.0
*/
public function search(string $search, string $objectType, string $objectId, string $verb, int $offset, int $limit = 50): array;