1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-30 03:30:17 +02:00

[ticket/16955] Fix another batch of docblocks

PHPBB3-16955
This commit is contained in:
Marc Alexander
2022-12-26 14:50:57 +01:00
parent 96911b7403
commit 5b23dcd606
25 changed files with 93 additions and 75 deletions

View File

@@ -14,6 +14,7 @@
namespace phpbb\report\controller;
use phpbb\exception\http_exception;
use phpbb\report\report_handler_interface;
use Symfony\Component\HttpFoundation\RedirectResponse;
class report
@@ -61,6 +62,9 @@ class report
/**
* @var \phpbb\report\handler_factory
*/
protected $report_factory;
/** @var report_handler_interface */
protected $report_handler;
/**
@@ -78,7 +82,7 @@ class report
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
$this->captcha_factory = $captcha_factory;
$this->report_handler = $report_factory;
$this->report_factory = $report_factory;
// User interface factory
$this->report_reason_provider = $ui_provider;
@@ -97,7 +101,7 @@ class report
public function handle($id, $mode)
{
// Get report handler
$this->report_handler = $this->report_handler->get_instance($mode);
$this->report_handler = $this->report_factory->get_instance($mode);
$this->user->add_lang('mcp');

View File

@@ -36,21 +36,28 @@ class handler_factory
* Return a new instance of an appropriate report handler
*
* @param string $type
* @return \phpbb\report\report_handler_interface
* @return report_handler_interface
* @throws factory_invalid_argument_exception if $type is not valid
*/
public function get_instance($type)
{
$report_handler = null;
switch ($type)
{
case 'pm':
return $this->container->get('phpbb.report.handlers.report_handler_pm');
$report_handler = $this->container->get('phpbb.report.handlers.report_handler_pm');
break;
case 'post':
return $this->container->get('phpbb.report.handlers.report_handler_post');
$report_handler = $this->container->get('phpbb.report.handlers.report_handler_post');
break;
}
if ($report_handler instanceof report_handler_interface)
{
return $report_handler;
}
throw new factory_invalid_argument_exception();
}
}

View File

@@ -99,6 +99,6 @@ abstract class report_handler implements report_handler_interface
$sql = 'INSERT INTO ' . REPORTS_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary);
$this->db->sql_query($sql);
return $this->db->sql_nextid();
return (int) $this->db->sql_nextid();
}
}