Code Duplication    Length = 9-9 lines in 2 locations

src/Xhgui/Storage/PDO.php 1 location

@@ 267-275 (lines=9) @@
264
        while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
265
            $date = new \DateTime($row['request_time']);
266
            $formattedDate = $date->format('Y-m-d H:i');
267
            if (empty($aggregatedData[$formattedDate])) {
268
                $aggregatedData[$formattedDate] = [
269
                    'wall_times'    => [],
270
                    'cpu_times'     => [],
271
                    'mu_times'      => [],
272
                    'pmu_times'     => [],
273
                    'row_count'     => 0
274
                ];
275
            }
276
277
            $aggregatedData[$formattedDate]['wall_times'][] = $row['main_wt'];
278
            $aggregatedData[$formattedDate]['cpu_times'][]  = $row['main_cpu'];

src/Xhgui/Storage/File.php 1 location

@@ 258-266 (lines=9) @@
255
            );
256
            $formattedDate = $date->format('Y-m-d H:i');
257
258
            if (empty($result['result'][$formattedDate])) {
259
                $result['result'][$formattedDate] = [
260
                    'wall_times'    => [],
261
                    'cpu_times'     => [],
262
                    'mu_times'      => [],
263
                    'pmu_times'     => [],
264
                    'row_count'     => 0
265
                ];
266
            }
267
268
            $result['result'][$formattedDate]['wall_times'][]    = $row['profile']['main()']['wt'];
269
            $result['result'][$formattedDate]['cpu_times'][]     = $row['profile']['main()']['cpu'];