Renamed for easier understanding of the class's function

This commit is contained in:
Keir Nellyer 2016-07-07 17:51:05 -04:00
parent aab5daa446
commit e6de1ec13e
3 changed files with 10 additions and 10 deletions

View File

@ -9,7 +9,7 @@
/** @var User */
private $suspect;
/** @var ReporterReason[] */
/** @var UserReport[] */
private $reporters;
/** @var Int */
@ -20,7 +20,7 @@
* @param Int $id
* @param User|Null $handler
* @param User $suspect
* @param ReporterReason[] $reporters
* @param UserReport[] $reporters
* @param Int $category
*/
function __construct($id, $handler, $suspect, $reporters, $category)
@ -41,11 +41,11 @@
}
/**
* @return ReporterReason
* @return UserReport
*/
private function getOldestReport()
{
/** @var ReporterReason $oldestReason */
/** @var UserReport $oldestReason */
$oldestReason = null;
foreach ($this->reporters as $reason)
@ -84,7 +84,7 @@
}
/**
* @return ReporterReason[]
* @return UserReport[]
*/
public function getReporters()
{

View File

@ -1,4 +1,4 @@
<?php class ReporterReason
<?php class UserReport
{
private $user;
private $time;

View File

@ -4,7 +4,7 @@ require_once('snapshot.php');
require_once('report.php');
require_once('message.php');
require_once('user.php');
require_once('reporter_reason.php');
require_once('user_report.php');
const CATEGORIES = array(
0 => 'Global',
@ -238,7 +238,7 @@ function getUser($id)
/**
* @param int $reportId
* @return ReporterReason[]
* @return UserReport[]
*/
function getReporters($reportId)
{
@ -255,7 +255,7 @@ function getReporters($reportId)
while ($statement->fetch())
{
$reportReasons[$reporterId] = new ReporterReason(getUser($reporterId), new DateTime($time), $reason);
$reportReasons[$reporterId] = new UserReport(getUser($reporterId), new DateTime($time), $reason);
}
}
finally
@ -276,7 +276,7 @@ function getInvolvedUsers($snapshot, $report)
$involvedUsers = $snapshot->getPlayers();
$involvedUsers[$report->getSuspect()->getId()] = $report->getSuspect();
/** @var ReporterReason $reporter */
/** @var UserReport $reporter */
foreach ($report->getReporters() as $reporterReason) {
$reporter = $reporterReason->getUser();
$involvedUsers[$reporter->getId()] = $reporter;