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

@@ 249-257 (lines=9) @@
246
        while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
247
            $date = new \DateTime($row['request_time']);
248
            $formattedDate = $date->format('Y-m-d H:i');
249
            if (empty($aggregatedData[$formattedDate])) {
250
                $aggregatedData[$formattedDate] = [
251
                    'wall_times'    => [],
252
                    'cpu_times'     => [],
253
                    'mu_times'      => [],
254
                    'pmu_times'     => [],
255
                    'row_count'     => 0
256
                ];
257
            }
258
259
            $aggregatedData[$formattedDate]['wall_times'][] = $row['main_wt'];
260
            $aggregatedData[$formattedDate]['cpu_times'][]  = $row['main_cpu'];