Completed
Push — work-fleets ( 33857b...22a48f )
by SuperNova.WS
05:55
created

Mission::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 14
rs 9.4285
1
<?php
2
3
namespace Mission;
4
5
use Fleet;
6
7
/**
8
 * User: Gorlum
9
 * Date: 06.02.2016
10
 * Time: 22:30
11
 */
12
class Mission {
13
  /**
14
   * @var int
15
   */
16
  public $type = MT_NONE;
17
18
  /**
19
   * @var Fleet $fleet
20
   */
21
  public $fleet;
22
23
  /**
24
   * @var array
25
   */
26
  public $src_user;
27
  /**
28
   * @var array
29
   */
30
  public $src_planet;
31
32
  /**
33
   * @var array
34
   */
35
  public $dst_user;
36
  /**
37
   * @var array
38
   */
39
  public $dst_planet;
40
41
  /**
42
   * @var array
43
   */
44
  public $fleet_event;
45
46
//  protected $validator;
47
48
  protected static $conditionsLocal = array();
49
50
  /**
51
   * Mission constructor.
52
   *
53
   * @param Fleet $fleet
54
   */
55
  public function __construct($fleet) {
56
//    $this->type = $type;
0 ignored issues
show
Unused Code Comprehensibility introduced by
45% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
57
    $this->fleet = $fleet;
58
59
//    $this->src_user = $fleet->dbOwnerRow;
0 ignored issues
show
Unused Code Comprehensibility introduced by
43% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
60
//    $this->src_planet = $fleet->dbSourcePlanetRow;
61
//
62
//    $this->dst_user = $fleet->dbTargetOwnerRow;
63
//    $this->dst_planet = $fleet->dbTargetRow;
64
//
65
//    $this->fleet_event = array();
66
67
//    $this->validator = new \FleetValidator($fleet);
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
68
  }
69
70
  public function validate() {
71
    try {
72
      $result = $this->fleet->validator->checkMissionRestrictions(static::$conditionsLocal);
73
    } catch (\ExceptionFleetInvalid $e) {
74
      $result = $e->getCode();
75
    }
76
77
    return $result;
78
  }
79
80
}
81