Commit 1cb1eb80 authored by Brian Hatchet's avatar Brian Hatchet :speech_balloon:

removing log

1 merge request!467When an entity gets reported, save a copy that can't be edited
Pipeline #119067981 passed with stages
in 7 minutes and 34 seconds
......@@ -87,19 +87,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,6 @@ class Manager
{
// Return the latest report, or the same supplied report if none exist
$report = $this->reportsManager->getLatestReport($userReport->getReport());
if ($report->getState() !== 'reported'
&& !in_array($report->getEntity()->type, [ 'user', 'group' ], true)
) {
......
Please register or to comment