Completed
Push — work-fleets ( 5c3a01...351cf4 )
by SuperNova.WS
06:40
created

V2UnitContainer::__construct()   C

Complexity

Conditions 7
Paths 1

Size

Total Lines 37
Code Lines 24

Duplication

Lines 20
Ratio 54.05 %

Code Coverage

Tests 0
CRAP Score 56

Importance

Changes 7
Bugs 1 Features 0
Metric Value
cc 7
eloc 24
nc 1
nop 1
dl 20
loc 37
rs 6.7272
c 7
b 1
f 0
ccs 0
cts 28
cp 0
crap 56
1
<?php
2
/**
3
 * Created by Gorlum 10.08.2016 14:25
4
 */
5
6
namespace V2Unit;
7
8
/**
9
 * Class V2UnitContainer
10
 *
11
 * @method V2UnitModel getModel()
12
 *
13
 * @property int|string $dbId Entity DB ID
14
 * @property int|string $playerOwnerId
15
 * @property int        $locationType
16
 * @property int|string $locationId
17
 * @property int        $type
18
 * @property int        $snId
19
 * @property int        $level - level of unit for DB: $count for stackable units, $level - fon unstackable units
20
 * @property \DateTime  $timeStart
21
 * @property \DateTime  $timeFinish
22
 *
23
 * @property bool       $isStackable
24
 * @property string     $locationDefaultType
25
 * @property int        $bonusType
26
 * @property array      $unitInfo - full info about unit
27
 *
28
 * @package V2Unit
29
 */
30
class V2UnitContainer extends \EntityContainer {
31
32
  public function isEmpty() {
33
    return
34
      empty($this->playerOwnerId)
35
      ||
36
      is_null($this->locationType)
37
      ||
38
      $this->locationType === LOC_NONE
39
      ||
40
      empty($this->locationId)
41
      ||
42
      empty($this->type)
43
      ||
44
      empty($this->snId)
45
      ||
46
      empty($this->level);
47
  }
48
49
}
50