Code Duplication    Length = 10-10 lines in 2 locations

includes/classes/UnitList.php 2 locations

@@ 268-277 (lines=10) @@
265
    return $this->unitsPropertySumById($unit_id, 'count');
266
  }
267
268
  public function unitsPropertySumById($unit_id = 0, $propertyName = 'count') {
269
    $result = 0;
270
    foreach($this->mapUnitIdToDb as $unit) {
271
      if(!$unit_id || $unit->unitId == $unit_id) {
272
        $result += $unit->$propertyName;
273
      }
274
    }
275
276
    return $result;
277
  }
278
279
  // TODO - WRONG FOR STRUCTURES
280
  public function shipsCapacity() {
@@ 285-294 (lines=10) @@
282
  }
283
284
  // TODO - WRONG FOR STRUCTURES
285
  public function shipsPoolPropertySumById($unit_id = 0, $propertyName = 'count') {
286
    $result = 0;
287
    foreach($this->mapUnitIdToDb as $unit) {
288
      if(!$unit_id || $unit->unitId == $unit_id) {
289
        $result += $unit->$propertyName * $unit->count;
290
      }
291
    }
292
293
    return $result;
294
  }
295
296
  public function shipsIsEnoughOnPlanet($dbPlanetRow) {
297
    $player = null;