LPH
Well-known member
In adding validate to posting externally, the following was added.
XenForo developers used
PHP:
/** @var \XF\Service\Thread\Replier $replier */
$replier = \XF::app()->service('XF:Thread\Replier', $thread);
$replier->setMessage($message);
if (!$replier->validate())
{
return array();
}
$post = $replier->save();
XenForo developers used
return;
but PhpStorm wants an array. Is it better to use return array();
or return null;
?