Code Duplication    Length = 10-11 lines in 3 locations

src/Plugins/onMessage/config.php 3 locations

@@ 128-137 (lines=10) @@
125
                $typeID = trim($input[3]);
126
127
                switch ($typeName) {
128
                    case "character":
129
                        // Check said char exists on the killboard..
130
                        $exists = json_decode($this->curl->get("https://evedata.xyz/api/character/information/{$typeID}/"));
131
                        if (isset($exists->characterID)) {
132
                            $this->db->execute("INSERT IGNORE INTO killmailPosting (channelID, typeName, typeID) VALUES (:channelID, :typeName, :typeID)", array(":channelID" => $channelID, ":typeName" => $typeName, ":typeID" => $typeID));
133
                            $msg = "**Success** killmails should start getting posted for {$exists->characterName} to this channel";
134
                        } else {
135
                            $msg = "**Error** characterID is not valid";
136
                        }
137
                        break;
138
139
                    case "corporation":
140
                        // Check said char exists on the killboard..
@@ 139-149 (lines=11) @@
136
                        }
137
                        break;
138
139
                    case "corporation":
140
                        // Check said char exists on the killboard..
141
                        $exists = json_decode($this->curl->get("https://evedata.xyz/api/corporation/information/{$typeID}/"));
142
                        if (isset($exists->corporationID)) {
143
                            $this->db->execute("INSERT IGNORE INTO killmailPosting (channelID, typeName, typeID) VALUES (:channelID, :typeName, :typeID)", array(":channelID" => $channelID, ":typeName" => $typeName, ":typeID" => $typeID));
144
                            $msg = "**Success** killmails should start getting posted for {$exists->corporationName} to this channel";
145
                        } else {
146
                            $msg = "**Error** corporationID is not valid";
147
                        }
148
149
                        break;
150
151
                    case "alliance":
152
                        // Check said char exists on the killboard..
@@ 151-160 (lines=10) @@
148
149
                        break;
150
151
                    case "alliance":
152
                        // Check said char exists on the killboard..
153
                        $exists = json_decode($this->curl->get("https://evedata.xyz/api/alliance/information/{$typeID}/"));
154
                        if (isset($exists->allianceID)) {
155
                            $this->db->execute("INSERT IGNORE INTO killmailPosting (channelID, typeName, typeID) VALUES (:channelID, :typeName, :typeID)", array(":channelID" => $channelID, ":typeName" => $typeName, ":typeID" => $typeID));
156
                            $msg = "**Success** killmails should start getting posted for {$exists->allianceName} to this channel";
157
                        } else {
158
                            $msg = "**Error** allianceID is not valid";
159
                        }
160
                        break;
161
                }
162
                break;
163
            case "removeKillmails":