Code Duplication    Length = 11-11 lines in 3 locations

SharedKernel/src/Kreta/SharedKernel/Infrastructure/Persistence/Doctrine/DataFixtures/AbstractFixture.php 1 location

@@ 57-67 (lines=11) @@
54
        return count($this->fakeIds());
55
    }
56
57
    protected function getRandomByIndex(int $index, array $list = null) : string
58
    {
59
        $list = null === $list ? $this->fakeIds() : $list;
60
61
        $numberOfUserIds = count($list);
62
        $j = $this->mod($index, $numberOfUserIds - 1) > $numberOfUserIds
63
            ? 0
64
            : $this->mod(($numberOfUserIds - ($index - 1)), $numberOfUserIds);
65
66
        return $list[$j];
67
    }
68
69
    protected function getRandomUserByIndex(int $index) : string
70
    {

SharedKernel/src/Kreta/SharedKernel/Infrastructure/Persistence/Fake/FakeDataCapabilities.php 1 location

@@ 39-49 (lines=11) @@
36
        return count($this->ids());
37
    }
38
39
    public function dataOfIndex(int $index, array $list = null) : string
40
    {
41
        $list = null === $list ? $this->ids() : $list;
42
43
        $numberOfUserIds = count($list);
44
        $j = $this->mod($index, $numberOfUserIds - 1) > $numberOfUserIds
45
            ? 0
46
            : $this->mod(($numberOfUserIds - ($index - 1)), $numberOfUserIds);
47
48
        return $list[$j];
49
    }
50
51
    private function mod(int $first, int $second) : int
52
    {

SharedKernel/src/Kreta/SharedKernel/Infrastructure/Persistence/Fake/UserFakeData.php 1 location

@@ 31-41 (lines=11) @@
28
        return count($this->ids());
29
    }
30
31
    public function userOfIndex(int $index, array $list = null) : string
32
    {
33
        $list = null === $list ? $this->ids() : $list;
34
35
        $numberOfUserIds = count($list);
36
        $j = $this->mod($index, $numberOfUserIds - 1) > $numberOfUserIds
37
            ? 0
38
            : $this->mod(($numberOfUserIds - ($index - 1)), $numberOfUserIds);
39
40
        return $list[$j];
41
    }
42
43
    private function mod(int $first, int $second) : int
44
    {