Code Duplication    Length = 9-9 lines in 2 locations

src/Xhgui/Storage/File.php 1 location

@@ 250-258 (lines=9) @@
247
            );
248
            $formattedDate = $date->format('Y-m-d H:i');
249
250
            if (empty($result['result'][$formattedDate])) {
251
                $result['result'][$formattedDate] = [
252
                    'wall_times'    => [],
253
                    'cpu_times'     => [],
254
                    'mu_times'      => [],
255
                    'pmu_times'     => [],
256
                    'row_count'     => 0
257
                ];
258
            }
259
260
            $result['result'][$formattedDate]['wall_times'][]    = $row['profile']['main()']['wt'];
261
            $result['result'][$formattedDate]['cpu_times'][]     = $row['profile']['main()']['cpu'];

src/Xhgui/Storage/PDO.php 1 location

@@ 233-241 (lines=9) @@
230
        while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
231
            $date = new \DateTime($row['request_time']);
232
            $formattedDate = $date->format('Y-m-d H:i');
233
            if (empty($aggregatedData[$formattedDate])) {
234
                $aggregatedData[$formattedDate] = [
235
                    'wall_times'    => [],
236
                    'cpu_times'     => [],
237
                    'mu_times'      => [],
238
                    'pmu_times'     => [],
239
                    'row_count'     => 0
240
                ];
241
            }
242
243
            $aggregatedData[$formattedDate]['wall_times'][] = $row['main_wt'];
244
            $aggregatedData[$formattedDate]['cpu_times'][]  = $row['main_cpu'];