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

View File

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

View File

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