Commit ac584c41 authored by Brian Hatchet's avatar Brian Hatchet :speech_balloon:

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

Revert "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"

This reverts commit 96815dc7.
1 merge request!461Fix/signed wire threshold export 2004
Pipeline #119067234 passed with stages
in 7 minutes and 19 seconds
......@@ -76,26 +76,19 @@ class Report
private $userHashes;
/** @var array $stateChanges */
private $stateChanges = ['reported'];
private $stateChanges;
/**
* @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() : string
public function getState()
{
if (!$this->stateChanges) {
return 'reported';
}
$sortedStates = $this->stateChanges;
arsort($sortedStates);
return $sortedStates[0];
return key($sortedStates);
}
/**
......
......@@ -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