War::setTimeFinished()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
namespace Perry\Representation\Eve\v1;
3
4
use \Perry\Representation\Reference as Reference;
5
use \Perry\Representation\Uri as Uri;
6
use \Perry\Representation\Base as Base;
7
8
class War extends Base
9
{
10
    public $timeFinished;
11
12
    public $openForAllies;
13
14
    public $allies = [];
15
16
    public $timeStarted;
17
18
    public $allyCount;
19
20
    public $timeDeclared;
21
22
    public $aggressor;
23
24
    public $mutual;
25
26
    public $killmails;
27
28
    public $timeRetracted;
29
30
    public $defender;
31
32
    public $id;
33
34
    // by Warringer\Types\String
35
    public function setTimeFinished($timeFinished)
36
    {
37
        $this->timeFinished = $timeFinished;
38
    }
39
40
    // by Warringer\Types\Base
41
    public function setOpenForAllies($openForAllies)
42
    {
43
        $this->openForAllies = $openForAllies;
44
    }
45
46
    // by Warringer\Types\ArrayType
47
    public function setAllies($allies)
48
    {
49
        // by Warringer\Types\Dict
50
        $converters = [];
51
        $converters['href'] = function ($value) { return new Uri($value); };
52
        $converters['id'] = function ($value) { return $value; };
53
        $converters['name'] = function ($value) { return $value; };
54
        $converters['icon'] = function ($value) { return new Reference($value); };
55
56
        $func = function ($value) use($converters) {
57
            $return = new \ArrayObject($value, \ArrayObject::ARRAY_AS_PROPS);
58
            $return['href'] = isset($value->{'href'}) ? $converters['href']($value->{'href'}) : null;
59
            $return['id'] = isset($value->{'id'}) ? $converters['id']($value->{'id'}) : null;
60
            $return['name'] = isset($value->{'name'}) ? $converters['name']($value->{'name'}) : null;
61
            $return['icon'] = isset($value->{'icon'}) ? $converters['icon']($value->{'icon'}) : null;
62
            return $return;
63
        };
64
65
        foreach ($allies as $key => $value) {
66
            $this->allies[$key] = $func($value);
67
        }
68
    }
69
70
    // by Warringer\Types\String
71
    public function setTimeStarted($timeStarted)
72
    {
73
        $this->timeStarted = $timeStarted;
74
    }
75
76
    // by Warringer\Types\Long
77
    public function setAllyCount($allyCount)
78
    {
79
        $this->allyCount = $allyCount;
80
    }
81
82
    // by Warringer\Types\String
83
    public function setTimeDeclared($timeDeclared)
84
    {
85
        $this->timeDeclared = $timeDeclared;
86
    }
87
88
    // by Warringer\Types\Dict
89
    public function setAggressor($aggressor)
90
    {
91
        // by Warringer\Types\Dict
92
        $converters = [];
93
        $converters['shipsKilled'] = function ($value) { return $value; };
94
        $converters['name'] = function ($value) { return $value; };
95
        $converters['href'] = function ($value) { return new Uri($value); };
96
        $converters['icon'] = function ($value) { return new Reference($value); };
97
        $converters['id'] = function ($value) { return $value; };
98
        $converters['iskKilled'] = function ($value) { return $value; };
99
100
        $func = function ($value) use($converters) {
101
            $return = new \ArrayObject($value, \ArrayObject::ARRAY_AS_PROPS);
102
            $return['shipsKilled'] = isset($value->{'shipsKilled'}) ? $converters['shipsKilled']($value->{'shipsKilled'}) : null;
103
            $return['name'] = isset($value->{'name'}) ? $converters['name']($value->{'name'}) : null;
104
            $return['href'] = isset($value->{'href'}) ? $converters['href']($value->{'href'}) : null;
105
            $return['icon'] = isset($value->{'icon'}) ? $converters['icon']($value->{'icon'}) : null;
106
            $return['id'] = isset($value->{'id'}) ? $converters['id']($value->{'id'}) : null;
107
            $return['iskKilled'] = isset($value->{'iskKilled'}) ? $converters['iskKilled']($value->{'iskKilled'}) : null;
108
            return $return;
109
        };
110
        $this->aggressor = $func($aggressor);
111
    }
112
113
    // by Warringer\Types\Base
114
    public function setMutual($mutual)
115
    {
116
        $this->mutual = $mutual;
117
    }
118
119
    // by Warringer\Types\Uri
120
    public function setKillmails($killmails)
121
    {
122
        $this->killmails = new Uri($killmails);
123
    }
124
125
    // by Warringer\Types\String
126
    public function setTimeRetracted($timeRetracted)
127
    {
128
        $this->timeRetracted = $timeRetracted;
129
    }
130
131
    // by Warringer\Types\Dict
132
    public function setDefender($defender)
133
    {
134
        // by Warringer\Types\Dict
135
        $converters = [];
136
        $converters['shipsKilled'] = function ($value) { return $value; };
137
        $converters['name'] = function ($value) { return $value; };
138
        $converters['href'] = function ($value) { return new Uri($value); };
139
        $converters['icon'] = function ($value) { return new Reference($value); };
140
        $converters['id'] = function ($value) { return $value; };
141
        $converters['iskKilled'] = function ($value) { return $value; };
142
143
        $func = function ($value) use($converters) {
144
            $return = new \ArrayObject($value, \ArrayObject::ARRAY_AS_PROPS);
145
            $return['shipsKilled'] = isset($value->{'shipsKilled'}) ? $converters['shipsKilled']($value->{'shipsKilled'}) : null;
146
            $return['name'] = isset($value->{'name'}) ? $converters['name']($value->{'name'}) : null;
147
            $return['href'] = isset($value->{'href'}) ? $converters['href']($value->{'href'}) : null;
148
            $return['icon'] = isset($value->{'icon'}) ? $converters['icon']($value->{'icon'}) : null;
149
            $return['id'] = isset($value->{'id'}) ? $converters['id']($value->{'id'}) : null;
150
            $return['iskKilled'] = isset($value->{'iskKilled'}) ? $converters['iskKilled']($value->{'iskKilled'}) : null;
151
            return $return;
152
        };
153
        $this->defender = $func($defender);
154
    }
155
156
    // by Warringer\Types\Long
157
    public function setId($id)
158
    {
159
        $this->id = $id;
160
    }
161
162
}
163