- added missing type-hints
- added missing documentation
- changed double-quotes to single
- Setters do ALWAYS return void
* @return Post|bool Last Post object or bool on any error
* @throws \Exception
*/
- public function addChild(Post $item)
+ public function addChild(Post $post)
{
if (!$item->getId()) {
Logger::error('Post object has no id', ['post' => $item]);
return false;
}
- $item->setParent($this);
- $this->children[] = $item;
+ $post->setParent($this);
+ $this->children[] = $post;
return end($this->children);
}