| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | public static function db_missile_insert($target_coord, $user, $planetrow, $arrival, $fleet_ship_count, $target_structure) { |
||
| 10 | classSupernova::$db->doInsertSet(TABLE_MISSILES, array( |
||
| 11 | 'fleet_target_owner' => $target_coord['id_owner'], |
||
| 12 | 'fleet_end_galaxy' => $target_coord['galaxy'], |
||
| 13 | 'fleet_end_system' => $target_coord['system'], |
||
| 14 | 'fleet_end_planet' => $target_coord['planet'], |
||
| 15 | 'fleet_owner' => $user['id'], |
||
| 16 | 'fleet_start_galaxy' => $planetrow['galaxy'], |
||
| 17 | 'fleet_start_system' => $planetrow['system'], |
||
| 18 | 'fleet_start_planet' => $planetrow['planet'], |
||
| 19 | 'fleet_end_time' => $arrival, |
||
| 20 | 'fleet_amount' => $fleet_ship_count, |
||
| 21 | 'primaer' => $target_structure, |
||
| 22 | )); |
||
| 23 | } |
||
| 24 | |||
| 48 | } |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: