Code Duplication    Length = 16-16 lines in 2 locations

demo/list-table.php 1 location

@@ 107-122 (lines=16) @@
104
$rows = $nameCount;
105
// Casual algorithm, but solid result
106
$seed = 42;
107
for ($j = 0; $j < $rows; $j++) {
108
    $seed = round((100 + $seed) / 100);
109
    $seed = 101 + $seed * ($j + 2);
110
    $data[$j] = [
111
        'uuid'  => $j,
112
        'title' => $name[$j],
113
        'age'   => $seed % 40 + 20,
114
        'credit'    => $seed,
115
        'joindate'  => date(
116
            'Y-m-d H:i:s',
117
            strtotime(
118
                '-' . ($seed % 30) . ' days -' . ($seed % 12) . ' hours'
119
            )
120
        )
121
    ];
122
}
123
124
// Write data to db
125
$db->write($tableUser, $data);

demo/list-view/list-view.php 1 location

@@ 63-78 (lines=16) @@
60
$data = [];
61
// Casual algorithm, but solid result
62
$seed = 42;
63
for ($j = 0; $j < $nameCount; $j++) {
64
    $seed = round((100 + $seed) / 100);
65
    $seed = 101 + $seed * ($j + 2);
66
    $data[$j] = [
67
        'uuid'  => $j,
68
        'title' => $names[$j],
69
        'age'   => $seed % 40 + 20,
70
        'credit'    => $seed,
71
        'joindate'  => date(
72
            'Y-m-d H:i:s',
73
            strtotime(
74
                '-' . ($seed % 30) . ' days -' . ($seed % 12) . ' hours'
75
            )
76
        )
77
    ];
78
}
79
80
// Write data to db
81
$db->write($tableUser, $data);