AndyB
Well-known member
I extended XF\Entity\Forum::getNewContentState but I get the following error message when trying to view a thread.
An exception occurred: [ErrorException] [E_WARNING] Declaration of Andy\ShadowBan\XF\Entity\Forum::getNewContentState(?Andy\ShadowBan\XF\Entity\Thread $thread = NULL) should be compatible with XF\Entity\Forum::getNewContentState(?XF\Entity\Thread $thread = NULL) in src/addons/Andy/ShadowBan/XF/Entity/Forum.php on line 31
This is the PHP code I'm using:
What is the proper way to extend the getNewContentState function?
Thank you.
An exception occurred: [ErrorException] [E_WARNING] Declaration of Andy\ShadowBan\XF\Entity\Forum::getNewContentState(?Andy\ShadowBan\XF\Entity\Thread $thread = NULL) should be compatible with XF\Entity\Forum::getNewContentState(?XF\Entity\Thread $thread = NULL) in src/addons/Andy/ShadowBan/XF/Entity/Forum.php on line 31
This is the PHP code I'm using:
PHP:
<?php
namespace Andy\ShadowBan\XF\Entity;
class Forum extends XFCP_Forum
{
public function getNewContentState(Thread $thread = null)
{
...
}
}
What is the proper way to extend the getNewContentState function?
Thank you.