return $this->tree;
}
+ public function canUpdateAny(): bool
+ {
+ foreach ($this->comments as $comment) {
+ if (userCan('comment-update', $comment)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
/**
* @param Comment[] $comments
*/
}
$tree = [];
- foreach ($childMap[0] as $childId) {
+ foreach ($childMap[0] ?? [] as $childId) {
$tree[] = $this->createTreeForId($childId, 0, $byId, $childMap);
}