@@ -25,7 +25,7 @@ |
||
25 | 25 | { |
26 | 26 | $this->setViolations($violations); |
27 | 27 | |
28 | - parent::__construct((string) $this); |
|
28 | + parent::__construct((string)$this); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | public function fetchOneBy(array $where = []) |
80 | 80 | { |
81 | 81 | $queryBuilder = $this->connection->createQueryBuilder() |
82 | - ->select('*') |
|
83 | - ->from(self::TABLE) |
|
84 | - ->setMaxResults(1); |
|
82 | + ->select('*') |
|
83 | + ->from(self::TABLE) |
|
84 | + ->setMaxResults(1); |
|
85 | 85 | |
86 | 86 | if (count($where) > 0) { |
87 | 87 | foreach ($where as $column => $value) { |
@@ -112,8 +112,8 @@ discard block |
||
112 | 112 | public function fetchBy(array $where = []) |
113 | 113 | { |
114 | 114 | $queryBuilder = $this->connection->createQueryBuilder() |
115 | - ->select('*') |
|
116 | - ->from(self::TABLE); |
|
115 | + ->select('*') |
|
116 | + ->from(self::TABLE); |
|
117 | 117 | |
118 | 118 | if (count($where) > 0) { |
119 | 119 | foreach ($where as $column => $value) { |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | $databaseArray |
181 | 181 | ); |
182 | 182 | |
183 | - $entity->id = (int) $this->connection->lastInsertId(); |
|
183 | + $entity->id = (int)$this->connection->lastInsertId(); |
|
184 | 184 | |
185 | 185 | return $entity; |
186 | 186 | } |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | ['id' => $entity->id] |
208 | 208 | ); |
209 | 209 | |
210 | - $entity->id = (int) $this->connection->lastInsertId(); |
|
210 | + $entity->id = (int)$this->connection->lastInsertId(); |
|
211 | 211 | |
212 | 212 | return $entity; |
213 | 213 | } |
@@ -280,27 +280,27 @@ discard block |
||
280 | 280 | public function getEntityFromDatabaseArray(array $data) |
281 | 281 | { |
282 | 282 | $entity = new GeoCacheLogEntity(); |
283 | - $entity->id = (int) $data['id']; |
|
283 | + $entity->id = (int)$data['id']; |
|
284 | 284 | $entity->uuid = $data['uuid']; |
285 | - $entity->node = (int) $data['node']; |
|
285 | + $entity->node = (int)$data['node']; |
|
286 | 286 | $entity->dateCreated = new DateTime($data['date_created']); |
287 | 287 | $entity->entryLastModified = new DateTime($data['entry_last_modified']); |
288 | 288 | $entity->lastModified = new DateTime($data['last_modified']); |
289 | - $entity->okapiSyncbase = (int) $data['okapi_syncbase']; |
|
289 | + $entity->okapiSyncbase = (int)$data['okapi_syncbase']; |
|
290 | 290 | $entity->logLastModified = new DateTime($data['log_last_modified']); |
291 | - $entity->cacheId = (int) $data['cache_id']; |
|
292 | - $entity->userId = (int) $data['user_id']; |
|
293 | - $entity->type = (int) $data['type']; |
|
294 | - $entity->ocTeamComment = (bool) $data['oc_team_comment']; |
|
291 | + $entity->cacheId = (int)$data['cache_id']; |
|
292 | + $entity->userId = (int)$data['user_id']; |
|
293 | + $entity->type = (int)$data['type']; |
|
294 | + $entity->ocTeamComment = (bool)$data['oc_team_comment']; |
|
295 | 295 | $entity->date = new DateTime($data['date']); |
296 | 296 | $entity->orderDate = new DateTime($data['order_date']); |
297 | - $entity->needsMaintenance = (bool) $data['needs_maintenance']; |
|
298 | - $entity->listingOutdated = (bool) $data['listing_outdated']; |
|
297 | + $entity->needsMaintenance = (bool)$data['needs_maintenance']; |
|
298 | + $entity->listingOutdated = (bool)$data['listing_outdated']; |
|
299 | 299 | $entity->text = $data['text']; |
300 | - $entity->textHtml = (bool) $data['text_html']; |
|
301 | - $entity->textHtmledit = (bool) $data['text_htmledit']; |
|
302 | - $entity->ownerNotified = (bool) $data['owner_notified']; |
|
303 | - $entity->picture = (int) $data['picture']; |
|
300 | + $entity->textHtml = (bool)$data['text_html']; |
|
301 | + $entity->textHtmledit = (bool)$data['text_htmledit']; |
|
302 | + $entity->ownerNotified = (bool)$data['owner_notified']; |
|
303 | + $entity->picture = (int)$data['picture']; |
|
304 | 304 | |
305 | 305 | return $entity; |
306 | 306 | } |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | public function fetchOneBy(array $where = []) |
80 | 80 | { |
81 | 81 | $queryBuilder = $this->connection->createQueryBuilder() |
82 | - ->select('*') |
|
83 | - ->from(self::TABLE) |
|
84 | - ->setMaxResults(1); |
|
82 | + ->select('*') |
|
83 | + ->from(self::TABLE) |
|
84 | + ->setMaxResults(1); |
|
85 | 85 | |
86 | 86 | if (count($where) > 0) { |
87 | 87 | foreach ($where as $column => $value) { |
@@ -112,8 +112,8 @@ discard block |
||
112 | 112 | public function fetchBy(array $where = []) |
113 | 113 | { |
114 | 114 | $queryBuilder = $this->connection->createQueryBuilder() |
115 | - ->select('*') |
|
116 | - ->from(self::TABLE); |
|
115 | + ->select('*') |
|
116 | + ->from(self::TABLE); |
|
117 | 117 | |
118 | 118 | if (count($where) > 0) { |
119 | 119 | foreach ($where as $column => $value) { |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | $databaseArray |
185 | 185 | ); |
186 | 186 | |
187 | - $entity->cacheId = (int) $this->connection->lastInsertId(); |
|
187 | + $entity->cacheId = (int)$this->connection->lastInsertId(); |
|
188 | 188 | |
189 | 189 | return $entity; |
190 | 190 | } |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | ['cache_id' => $entity->cacheId] |
212 | 212 | ); |
213 | 213 | |
214 | - $entity->cacheId = (int) $this->connection->lastInsertId(); |
|
214 | + $entity->cacheId = (int)$this->connection->lastInsertId(); |
|
215 | 215 | |
216 | 216 | return $entity; |
217 | 217 | } |
@@ -300,38 +300,38 @@ discard block |
||
300 | 300 | $entity = new GeoCacheEntity(); |
301 | 301 | $entity->cacheId = $data['cache_id']; |
302 | 302 | $entity->uuid = $data['uuid']; |
303 | - $entity->node = (int) $data['node']; |
|
303 | + $entity->node = (int)$data['node']; |
|
304 | 304 | $entity->dateCreated = new DateTime($data['date_created']); |
305 | - $entity->isPublishdate = (bool) $data['is_publishdate']; |
|
305 | + $entity->isPublishdate = (bool)$data['is_publishdate']; |
|
306 | 306 | $entity->lastModified = new DateTime($data['last_modified']); |
307 | - $entity->okapiSyncbase = (int) $data['okapi_syncbase']; |
|
307 | + $entity->okapiSyncbase = (int)$data['okapi_syncbase']; |
|
308 | 308 | $entity->listingLastModified = new DateTime($data['listing_last_modified']); |
309 | 309 | $entity->metaLastModified = new DateTime($data['meta_last_modified']); |
310 | - $entity->userId = (int) $data['user_id']; |
|
310 | + $entity->userId = (int)$data['user_id']; |
|
311 | 311 | $entity->name = $data['name']; |
312 | - $entity->longitude = (double) $data['longitude']; |
|
313 | - $entity->latitude = (double) $data['latitude']; |
|
314 | - $entity->type = (int) $data['type']; |
|
315 | - $entity->status = (int) $data['status']; |
|
312 | + $entity->longitude = (double)$data['longitude']; |
|
313 | + $entity->latitude = (double)$data['latitude']; |
|
314 | + $entity->type = (int)$data['type']; |
|
315 | + $entity->status = (int)$data['status']; |
|
316 | 316 | $entity->country = $data['country']; |
317 | 317 | $entity->dateHidden = new DateTime($data['date_hidden']); |
318 | - $entity->size = (int) $data['size']; |
|
319 | - $entity->difficulty = (int) $data['difficulty']; |
|
320 | - $entity->terrain = (int) $data['terrain']; |
|
318 | + $entity->size = (int)$data['size']; |
|
319 | + $entity->difficulty = (int)$data['difficulty']; |
|
320 | + $entity->terrain = (int)$data['terrain']; |
|
321 | 321 | $entity->logpw = $data['logpw']; |
322 | - $entity->searchTime = (float) $data['search_time']; |
|
323 | - $entity->wayLength = (float) $data['way_length']; |
|
322 | + $entity->searchTime = (float)$data['search_time']; |
|
323 | + $entity->wayLength = (float)$data['way_length']; |
|
324 | 324 | $entity->wpGc = $data['wp_gc']; |
325 | 325 | $entity->wpGcMaintained = $data['wp_gc_maintained']; |
326 | 326 | $entity->wpOc = $data['wp_oc']; |
327 | 327 | $entity->descLanguages = $data['desc_languages']; |
328 | 328 | $entity->defaultDesclang = $data['default_desclang']; |
329 | 329 | $entity->dateActivate = new DateTime($data['date_activate']); |
330 | - $entity->needNpaRecalc = (bool) $data['need_npa_recalc']; |
|
331 | - $entity->showCachelists = (bool) $data['show_cachelists']; |
|
332 | - $entity->protectOldCoords = (bool) $data['protect_old_coords']; |
|
333 | - $entity->needsMaintenance = (bool) $data['needs_maintenance']; |
|
334 | - $entity->listingOutdated = (bool) $data['listing_outdated']; |
|
330 | + $entity->needNpaRecalc = (bool)$data['need_npa_recalc']; |
|
331 | + $entity->showCachelists = (bool)$data['show_cachelists']; |
|
332 | + $entity->protectOldCoords = (bool)$data['protect_old_coords']; |
|
333 | + $entity->needsMaintenance = (bool)$data['needs_maintenance']; |
|
334 | + $entity->listingOutdated = (bool)$data['listing_outdated']; |
|
335 | 335 | $entity->flagsLastModified = new DateTime($data['flags_last_modified']); |
336 | 336 | |
337 | 337 | return $entity; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | ); |
38 | 38 | if ($r) { |
39 | 39 | if ($r['object_type'] == 1) { |
40 | - $check = (int) $connection |
|
40 | + $check = (int)$connection |
|
41 | 41 | ->fetchColumn( |
42 | 42 | 'SELECT COUNT(*) |
43 | 43 | FROM `cache_logs` |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | } |
64 | 64 | } elseif ($r['object_type'] == 2) { |
65 | - $check = (int) $connection |
|
65 | + $check = (int)$connection |
|
66 | 66 | ->fetchColumn( |
67 | 67 | 'SELECT COUNT(*) |
68 | 68 | FROM `caches` |
@@ -142,22 +142,22 @@ |
||
142 | 142 | |
143 | 143 | $tpl->assign('showdetails', true); |
144 | 144 | |
145 | - $r['hidden'] = (int) $connection->fetchColumn( |
|
145 | + $r['hidden'] = (int)$connection->fetchColumn( |
|
146 | 146 | 'SELECT COUNT(*) FROM `caches` WHERE `user_id`=:userId', [':userId' => $r['user_id']] |
147 | 147 | ); |
148 | - $r['hidden_active'] = (int) $connection->fetchColumn( |
|
148 | + $r['hidden_active'] = (int)$connection->fetchColumn( |
|
149 | 149 | 'SELECT COUNT(*) FROM `caches` WHERE `user_id`= :userId AND `status`=1', |
150 | 150 | [':userId' => $r['user_id']] |
151 | 151 | ); |
152 | - $r['logentries'] = (int) $connection->fetchColumn( |
|
152 | + $r['logentries'] = (int)$connection->fetchColumn( |
|
153 | 153 | 'SELECT COUNT(*) FROM `cache_logs` WHERE `user_id`= :userId', |
154 | 154 | [':userId' => $r['user_id']] |
155 | 155 | ); |
156 | - $r['deleted_logentries'] = (int) $connection->fetchColumn( |
|
156 | + $r['deleted_logentries'] = (int)$connection->fetchColumn( |
|
157 | 157 | 'SELECT COUNT(*) FROM `cache_logs_archived` WHERE `user_id`= :userId', |
158 | 158 | [':userId' => $r['user_id']] |
159 | 159 | ); |
160 | - $r['reports'] = (int) $connection->fetchColumn( |
|
160 | + $r['reports'] = (int)$connection->fetchColumn( |
|
161 | 161 | 'SELECT COUNT(*) FROM `cache_reports` WHERE `userid`= :userId', |
162 | 162 | [':userId' => $r['user_id']] |
163 | 163 | ); |
@@ -218,10 +218,10 @@ |
||
218 | 218 | $entity->nativeName = $data['native_name']; |
219 | 219 | $entity->de = $data['de']; |
220 | 220 | $entity->en = $data['en']; |
221 | - $entity->translationId = (int) $data['trans_id']; |
|
222 | - $entity->listDefaultDe = (bool) $data['list_default_de']; |
|
223 | - $entity->listDefaultEn = (bool) $data['list_default_en']; |
|
224 | - $entity->isTranslated = (bool) $data['is_translated']; |
|
221 | + $entity->translationId = (int)$data['trans_id']; |
|
222 | + $entity->listDefaultDe = (bool)$data['list_default_de']; |
|
223 | + $entity->listDefaultEn = (bool)$data['list_default_en']; |
|
224 | + $entity->isTranslated = (bool)$data['is_translated']; |
|
225 | 225 | |
226 | 226 | return $entity; |
227 | 227 | } |
@@ -181,9 +181,9 @@ |
||
181 | 181 | $entity->name = $data['name']; |
182 | 182 | $entity->de = $data['de']; |
183 | 183 | $entity->en = $data['en']; |
184 | - $entity->translationId = (int) $data['trans_id']; |
|
185 | - $entity->listDefaultDe = (bool) $data['list_default_de']; |
|
186 | - $entity->listDefaultEn = (bool) $data['list_default_en']; |
|
184 | + $entity->translationId = (int)$data['trans_id']; |
|
185 | + $entity->listDefaultDe = (bool)$data['list_default_de']; |
|
186 | + $entity->listDefaultEn = (bool)$data['list_default_en']; |
|
187 | 187 | $entity->sortDe = $data['sort_de']; |
188 | 188 | $entity->sortEn = $data['sort_en']; |
189 | 189 |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $databaseArray |
113 | 113 | ); |
114 | 114 | |
115 | - $entity->id = (int) $this->connection->lastInsertId(); |
|
115 | + $entity->id = (int)$this->connection->lastInsertId(); |
|
116 | 116 | |
117 | 117 | return $entity; |
118 | 118 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | ['id' => $entity->id] |
141 | 141 | ); |
142 | 142 | |
143 | - $entity->id = (int) $this->connection->lastInsertId(); |
|
143 | + $entity->id = (int)$this->connection->lastInsertId(); |
|
144 | 144 | |
145 | 145 | return $entity; |
146 | 146 | } |
@@ -222,13 +222,13 @@ discard block |
||
222 | 222 | public function getEntityFromDatabaseArray(array $data) |
223 | 223 | { |
224 | 224 | $entity = new UserEntity(); |
225 | - $entity->id = (int) $data['user_id']; |
|
225 | + $entity->id = (int)$data['user_id']; |
|
226 | 226 | $entity->username = $data['username']; |
227 | 227 | $entity->password = $data['password']; |
228 | 228 | $entity->email = $data['email']; |
229 | - $entity->latitude = (double) $data['latitude']; |
|
230 | - $entity->longitude = (double) $data['longitude']; |
|
231 | - $entity->isActive = (bool) $data['is_active_flag']; |
|
229 | + $entity->latitude = (double)$data['latitude']; |
|
230 | + $entity->longitude = (double)$data['longitude']; |
|
231 | + $entity->isActive = (bool)$data['is_active_flag']; |
|
232 | 232 | $entity->firstname = $data['first_name']; |
233 | 233 | $entity->lastname = $data['last_name']; |
234 | 234 | $entity->country = $data['country']; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public static function fromEMail($email) |
28 | 28 | { |
29 | - $userId = (int) sql_value("SELECT `user_id` FROM `user` WHERE `email`='&1'", 0, $email); |
|
29 | + $userId = (int)sql_value("SELECT `user_id` FROM `user` WHERE `email`='&1'", 0, $email); |
|
30 | 30 | if ($userId === 0) { |
31 | 31 | return null; |
32 | 32 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public static function fromUsername($username) |
43 | 43 | { |
44 | - $userId = (int) sql_value("SELECT `user_id` FROM `user` WHERE `username`='&1'", 0, $username); |
|
44 | + $userId = (int)sql_value("SELECT `user_id` FROM `user` WHERE `username`='&1'", 0, $username); |
|
45 | 45 | if ($userId === 0) { |
46 | 46 | return null; |
47 | 47 | } |