Code Duplication    Length = 17-17 lines in 2 locations

src/Workflows/ContentModerationGrid.php 1 location

@@ 24-40 (lines=17) @@
21
    $this->transStorage = $transStorage;
22
  }
23
24
  protected function buildGrid() {
25
    $grid = [];
26
    $stateIds = array_keys($this->getStates());
27
    $stateCells = array_map(function ($stateId) {
28
      return [];
29
    }, array_flip($stateIds));
30
31
    foreach ($stateIds as $stateId) {
32
      $grid[$stateId] = $stateCells;
33
    }
34
35
    foreach ($this->getTrans() as $transId => $trans) {
36
      $grid[$trans['from']][$trans['to']][] = $transId;
37
    }
38
39
    return $grid;
40
  }
41
42
  protected function buildRow(string $stateId, array $transList) {
43
    $states = $this->getStates();

src/Workflows/ContentModerationReportBase.php 1 location

@@ 16-32 (lines=17) @@
13
14
  protected $transStorage;
15
16
  protected function buildGrid() {
17
    $grid = [];
18
    $stateIds = array_keys($this->getStates());
19
    $stateCells = array_map(function ($stateId) {
20
      return [];
21
    }, array_flip($stateIds));
22
23
    foreach ($stateIds as $stateId) {
24
      $grid[$stateId] = $stateCells;
25
    }
26
27
    foreach ($this->getTrans() as $transId => $trans) {
28
      $grid[$trans['from']][$trans['to']][] = $transId;
29
    }
30
31
    return $grid;
32
  }
33
34
  public function getDuplicateTransLabels() {
35
    $labels = [];