1 | <?php |
||
12 | class Session { |
||
13 | /** @var array **/ |
||
14 | public $flashbags = []; |
||
15 | /** @var array **/ |
||
16 | protected $items = []; |
||
17 | /** @var array **/ |
||
18 | protected $history = []; |
||
19 | |||
20 | /** |
||
21 | * @param string $message |
||
22 | * @param string $type |
||
23 | */ |
||
24 | public function addFlashbag($message, $type) |
||
28 | |||
29 | /** |
||
30 | * @return array |
||
31 | */ |
||
32 | public function getFlashbags() |
||
36 | |||
37 | public function flushFlashbags() |
||
41 | |||
42 | /** |
||
43 | * @param string $key |
||
44 | * @param string $value |
||
45 | */ |
||
46 | public function add($key, $value) |
||
50 | |||
51 | /** |
||
52 | * @param string $key |
||
53 | * @return boolean |
||
54 | */ |
||
55 | public function exist($key) |
||
59 | |||
60 | /** |
||
61 | * @param string $key |
||
62 | * @return mixed |
||
63 | */ |
||
64 | public function get($key) |
||
68 | |||
69 | /** |
||
70 | * @return array |
||
71 | */ |
||
72 | public function all() |
||
76 | |||
77 | /** |
||
78 | * @param string $key |
||
79 | * @return boolean |
||
80 | */ |
||
81 | public function remove($key) { |
||
87 | |||
88 | public function destroy() { |
||
93 | |||
94 | public function clear() { |
||
99 | |||
100 | ## |
||
101 | |||
102 | public function initPlayerInfo() { |
||
105 | |||
106 | public function initPlayerBase() { |
||
113 | |||
114 | public function initPlayerEvent() { |
||
117 | |||
118 | public function initLastUpdate() { |
||
125 | |||
126 | public function initPlayerBonus() { |
||
129 | |||
130 | ## |
||
131 | /** |
||
132 | * @param string $key |
||
133 | * @param int $id |
||
134 | * @param string $name |
||
135 | * @param string $sector |
||
136 | * @param string $system |
||
137 | * @param string $img |
||
138 | * @param string $type |
||
139 | * @return boolean |
||
140 | */ |
||
141 | public function addBase($key, $id, $name, $sector, $system, $img, $type) { |
||
158 | |||
159 | /** |
||
160 | * @param string $key |
||
161 | * @param int $id |
||
162 | */ |
||
163 | public function removeBase($key, $id) { |
||
164 | if ($this->exist('playerBase')) { |
||
165 | $size = $this->get('playerBase')->get($key)->size(); |
||
166 | for ($i = 0; $i < $size; $i++) { |
||
167 | if ($this->get('playerBase')->get($key)->get($i)->get('id') == $id) { |
||
168 | $this->get('playerBase')->get($key)->remove($i); |
||
169 | return; |
||
170 | } |
||
171 | } |
||
172 | } |
||
173 | } |
||
174 | |||
175 | /** |
||
176 | * @param int $id |
||
177 | * @return boolean |
||
178 | */ |
||
179 | public function baseExist($id) { |
||
194 | |||
195 | /** |
||
196 | * @param string $path |
||
197 | */ |
||
198 | public function addHistory($path) |
||
202 | |||
203 | /** |
||
204 | * @return array |
||
205 | */ |
||
206 | public function getHistory() |
||
210 | |||
211 | /** |
||
212 | * @return string |
||
213 | */ |
||
214 | public function getLastHistory() |
||
218 | |||
219 | /** |
||
220 | * @return int |
||
221 | */ |
||
222 | public function getLifetime() |
||
226 | |||
227 | public function setData($data) |
||
233 | |||
234 | public function getData() |
||
242 | } |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: