From 03e09627e4f2f59e685e84e237bd65bfff45be96 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 26 Oct 2022 17:55:52 +0200 Subject: [PATCH] Used `$this->isThreaded()` instead as suggested by @MrPetovan --- src/Object/Post.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/Object/Post.php b/src/Object/Post.php index 7467e4ffc7..ddbc1a7368 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -587,16 +587,10 @@ class Post // Copy values/set defaults $result['total_comments_num'] = $this->isToplevel() ? $total_children : 0; - $result['private'] = $item['private']; - $result['toplevel'] = ($this->isToplevel() ? 'toplevel_item' : ''); - $result['flatten'] = false; - $result['threaded'] = false; - - if ($this->isThreaded()) { - $result['threaded'] = true; - } else { - $result['flatten'] = true; - } + $result['private'] = $item['private']; + $result['toplevel'] = ($this->isToplevel() ? 'toplevel_item' : ''); + $result['flatten'] = !$this->isThreaded(); + $result['threaded'] = $this->isThreaded(); return $result; } -- 2.39.5