Code Duplication    Length = 6-6 lines in 2 locations

require/class.SpotterServer.php 1 location

@@ 44-49 (lines=6) @@
41
		        $Spotter = new Spotter();
42
		        $aircraft_icao = $Spotter->getAllAircraftType($data['hex']);
43
		        $Spotter->db = null;
44
			if ($aircraft_icao == '' && isset($line['aircraft_type'])) {
45
			    if ($line['aircraft_type'] == 'PARA_GLIDER') $aircraft_icao = 'GLID';
46
			    elseif ($line['aircraft_type'] == 'HELICOPTER_ROTORCRAFT') $aircraft_icao = 'UHEL';
47
			    elseif ($line['aircraft_type'] == 'TOW_PLANE') $aircraft_icao = 'TOWPLANE';
48
			    elseif ($line['aircraft_type'] == 'POWERED_AIRCRAFT') $aircraft_icao = 'POWAIRC';
49
			}
50
			$data['aircraft_icao'] = $aircraft_icao;
51
		    } else $data['aircraft_icao'] = $line['aircraft_icao'];
52
		    //if ($globalDebug) echo "*********** New aircraft hex : ".$data['hex']." ***********\n";

require/class.SpotterImport.php 1 location

@@ 259-264 (lines=6) @@
256
			$Spotter->db = null;
257
			if ($globalDebugTimeElapsed) echo 'Time elapsed for update getallaircrattype : '.round(microtime(true)-$timeelapsed,2).'s'."\n";
258
259
			if ($aircraft_icao == '' && isset($line['aircraft_type'])) {
260
			    if ($line['aircraft_type'] == 'PARA_GLIDER') $aircraft_icao = 'GLID';
261
			    elseif ($line['aircraft_type'] == 'HELICOPTER_ROTORCRAFT') $aircraft_icao = 'UHEL';
262
			    elseif ($line['aircraft_type'] == 'TOW_PLANE') $aircraft_icao = 'TOWPLANE';
263
			    elseif ($line['aircraft_type'] == 'POWERED_AIRCRAFT') $aircraft_icao = 'POWAIRC';
264
			}
265
			$this->all_flights[$id] = array_merge($this->all_flights[$id],array('aircraft_icao' => $aircraft_icao));
266
		    } else $this->all_flights[$id] = array_merge($this->all_flights[$id],array('aircraft_icao' => $line['aircraft_icao']));
267
		    $this->all_flights[$id] = array_merge($this->all_flights[$id],array('ident' => '','departure_airport' => '', 'arrival_airport' => '','latitude' => '', 'longitude' => '', 'speed' => '', 'altitude' => '','altitude_real' => '', 'heading' => '','departure_airport_time' => '','arrival_airport_time' => '','squawk' => '','route_stop' => '','registration' => '','pilot_id' => '','pilot_name' => '','waypoints' => '','ground' => '0', 'format_source' => '','source_name' => '','over_country' => '','verticalrate' => '','noarchive' => false,'putinarchive' => false));