Code Duplication    Length = 6-6 lines in 2 locations

core/Federation.php 2 locations

@@ 113-118 (lines=6) @@
110
111
        switch ($format) {
112
            case "table":
113
                foreach ($data as $device => $numbers) {
114
                    if ($device == "TOTAL") {
115
                        continue;
116
                    }
117
                    $retstring .= "<tr><td>$device</td><td>" . $numbers['ADMIN'] . "</td><td>" . $numbers['SILVERBULLET'] . "</td><td>" . $numbers['USER'] . "</td></tr>";
118
                }
119
                $retstring .= "<tr><td><strong>TOTAL</strong></td><td><strong>" . $data['TOTAL']['ADMIN'] . "</strong></td><td><strong>" . $data['TOTAL']['SILVERBULLET'] . "</strong></td><td><strong>" . $data['TOTAL']['USER'] . "</strong></td></tr>";
120
                break;
121
            case "XML":
@@ 124-129 (lines=6) @@
121
            case "XML":
122
                // the calls to date() operate on current date, so there is no chance for a FALSE to be returned. Silencing scrutinizer.
123
                $retstring .= "<federation id='$this->identifier' ts='" . /** @scrutinizer ignore-type */ date("Y-m-d") . "T" . /** @scrutinizer ignore-type */ date("H:i:s") . "'>\n";
124
                foreach ($data as $device => $numbers) {
125
                    if ($device == "TOTAL") {
126
                        continue;
127
                    }
128
                    $retstring .= "  <device name='" . $device . "'>\n    <downloads group='admin'>" . $numbers['ADMIN'] . "</downloads>\n    <downloads group='managed_idp'>" . $numbers['SILVERBULLET'] . "</downloads>\n    <downloads group='user'>" . $numbers['USER'] . "</downloads>\n  </device>";
129
                }
130
                $retstring .= "<total>\n  <downloads group='admin'>" . $data['TOTAL']['ADMIN'] . "</downloads>\n  <downloads group='managed_idp'>" . $data['TOTAL']['SILVERBULLET'] . "</downloads>\n  <downloads group='user'>" . $data['TOTAL']['USER'] . "</downloads>\n</total>\n";
131
                $retstring .= "</federation>";
132
                break;