Commit 96815dc7 authored by Brian Hatchet's avatar Brian Hatchet :speech_balloon:

Fixing a bug with setState on the jury and moderation report. We refactored...

Fixing a bug with setState on the jury and moderation report. We refactored them to an array, but the setter didn't exist to actually push them onto the array
1 merge request!461Fix/signed wire threshold export 2004
Pipeline #119066780 passed with stages
in 7 minutes and 13 seconds
......@@ -76,19 +76,26 @@ class Report
private $userHashes;
/** @var array $stateChanges */
private $stateChanges;
private $stateChanges = ['reported'];
/**
* @param string $state pushes a state into our state change array
* @return Report this
*/
public function setState(string $state) : Report
{
$this->stateChanges[] = $state;
}
/**
* Return the state of the report from the state changes
*/
public function getState()
public function getState() : string
{
if (!$this->stateChanges) {
return 'reported';
}
$sortedStates = $this->stateChanges;
arsort($sortedStates);
return key($sortedStates);
return $sortedStates[0];
}
/**
......
......@@ -61,7 +61,7 @@ class Manager
{
// Return the latest report, or the same supplied report if none exist
$report = $this->reportsManager->getLatestReport($userReport->getReport());
var_dump($report->getState());
if ($report->getState() !== 'reported'
&& !in_array($report->getEntity()->type, [ 'user', 'group' ], true)
) {
......
Please register or to comment