Code Duplication    Length = 5-5 lines in 9 locations

src/plugins/onTick/notifications.php 9 locations

@@ 190-194 (lines=5) @@
187
                    $notificationString = explode("\n", $this->getNotificationText($keyID, $vCode, $characterID,
188
                        $notificationID));
189
                    switch ($typeID) {
190
                        case 5: // War Declared
191
                            $aggAllianceID = trim(explode(": ", $notificationString[2])[1]);
192
                            $aggAllianceName = apiCharacterName($aggAllianceID);
193
                            $msg = "@everyone | War declared by {$aggAllianceName}. Fighting begins in roughly 24 hours.";
194
                            break;
195
                        case 7: // War Declared corp
196
                            $aggCorpID = trim(explode(": ", $notificationString[2])[1]);
197
                            $aggCorpName = apiCharacterName($aggCorpID);
@@ 195-199 (lines=5) @@
192
                            $aggAllianceName = apiCharacterName($aggAllianceID);
193
                            $msg = "@everyone | War declared by {$aggAllianceName}. Fighting begins in roughly 24 hours.";
194
                            break;
195
                        case 7: // War Declared corp
196
                            $aggCorpID = trim(explode(": ", $notificationString[2])[1]);
197
                            $aggCorpName = apiCharacterName($aggCorpID);
198
                            $msg = "@everyone | War declared by {$aggCorpName}. Fighting begins in roughly 24 hours.";
199
                            break;
200
                        case 8: // Alliance war invalidated by CONCORD
201
                            $aggAllianceID = trim(explode(": ", $notificationString[2])[1]);
202
                            $aggAllianceName = apiCharacterName($aggAllianceID);
@@ 200-204 (lines=5) @@
197
                            $aggCorpName = apiCharacterName($aggCorpID);
198
                            $msg = "@everyone | War declared by {$aggCorpName}. Fighting begins in roughly 24 hours.";
199
                            break;
200
                        case 8: // Alliance war invalidated by CONCORD
201
                            $aggAllianceID = trim(explode(": ", $notificationString[2])[1]);
202
                            $aggAllianceName = apiCharacterName($aggAllianceID);
203
                            $msg = "War with {$aggAllianceName} has been invalidated. Fighting ends in roughly 24 hours.";
204
                            break;
205
                        case 10: // Bill issued
206
                            $msg = "skip";
207
                            break;
@@ 230-234 (lines=5) @@
227
                        case 21: // member left corp
228
                            $msg = "skip";
229
                            break;
230
                        case 31: // Alliance war invalidated by CONCORD
231
                            $aggAllianceID = trim(explode(": ", $notificationString[2])[1]);
232
                            $aggAllianceName = apiCharacterName($aggAllianceID);
233
                            $msg = "War with {$aggAllianceName} has been invalidated. Fighting ends in roughly 24 hours.";
234
                            break;
235
                        case 35: // Insurance payment
236
                            $msg = "skip";
237
                            break;
@@ 380-384 (lines=5) @@
377
                            $typeName = apiTypeName($typeID);
378
                            $msg = "Entosis has disabled a module in **{$systemName}** on **{$typeName}** (Date: **{$sentDate}**)";
379
                            break;
380
                        case 160: // Entosis successful
381
                            $solarSystemID = trim(explode(": ", $notificationString[2])[1]);
382
                            $systemName = apiCharacterName($solarSystemID);
383
                            $msg = "Hostile entosis successful. A structure in **{$systemName}** has entered reinforced mode.";
384
                            break;
385
                        case 161: //  Command Nodes Decloaking
386
                            $solarSystemID = trim(explode(": ", $notificationString[2])[1]);
387
                            $systemName = apiCharacterName($solarSystemID);
@@ 385-389 (lines=5) @@
382
                            $systemName = apiCharacterName($solarSystemID);
383
                            $msg = "Hostile entosis successful. A structure in **{$systemName}** has entered reinforced mode.";
384
                            break;
385
                        case 161: //  Command Nodes Decloaking
386
                            $solarSystemID = trim(explode(": ", $notificationString[2])[1]);
387
                            $systemName = apiCharacterName($solarSystemID);
388
                            $msg = "Command nodes decloaking for **{$systemName}**";
389
                            break;
390
                        case 162: //  TCU Destroyed
391
                            $solarSystemID = trim(explode(": ", $notificationString[0])[1]);
392
                            $systemName = apiCharacterName($solarSystemID);
@@ 390-394 (lines=5) @@
387
                            $systemName = apiCharacterName($solarSystemID);
388
                            $msg = "Command nodes decloaking for **{$systemName}**";
389
                            break;
390
                        case 162: //  TCU Destroyed
391
                            $solarSystemID = trim(explode(": ", $notificationString[0])[1]);
392
                            $systemName = apiCharacterName($solarSystemID);
393
                            $msg = "Entosis successful, TCU in **{$systemName}** has been destroyed.";
394
                            break;
395
                        case 163: //  Outpost freeport
396
                            $solarSystemID = trim(explode(": ", $notificationString[1])[1]);
397
                            $systemName = apiCharacterName($solarSystemID);
@@ 395-399 (lines=5) @@
392
                            $systemName = apiCharacterName($solarSystemID);
393
                            $msg = "Entosis successful, TCU in **{$systemName}** has been destroyed.";
394
                            break;
395
                        case 163: //  Outpost freeport
396
                            $solarSystemID = trim(explode(": ", $notificationString[1])[1]);
397
                            $systemName = apiCharacterName($solarSystemID);
398
                            $msg = "Station in **{$systemName}** has now entered freeport mode.";
399
                            break;
400
                        case 182: //  Citadel being anchored
401
                            $corpName = trim(explode(": ", $notificationString[1])[1]);
402
                            $solarSystemID = trim(explode(": ", $notificationString[2])[1]);
@@ 417-421 (lines=5) @@
414
                            $systemName = apiCharacterName($solarSystemID);
415
                            $msg = "@everyone | Citadel under attack in **{$systemName}** by **{$aggCharacterName}** ({$aggCorpName} / {$aggAllianceName}).";
416
                            break;
417
                        case 185: //  Citadel online
418
                            $solarSystemID = trim(explode(": ", $notificationString[0])[1]);
419
                            $systemName = apiCharacterName($solarSystemID);
420
                            $msg = "Citadel now online in **{$systemName}**.";
421
                            break;
422
                        case 188: //  Citadel destroyed
423
                            $corpID = trim(explode("- ", $notificationString[3])[1]);
424
                            $corpName = apiCharacterName($corpID);