@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | /** |
20 | - * @param $userCountry |
|
20 | + * @param string $userCountry |
|
21 | 21 | */ |
22 | 22 | public function set_userCountry($userCountry): void |
23 | 23 | { |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * |
42 | 42 | * @param string $type type of the "new"-information, i.e. cache, event, rating, etc |
43 | 43 | * @param array $args numeric array containing the parameter for "sql_slave" |
44 | - * @return object mysql result used by smarty assign_rs |
|
44 | + * @return mysqli_result|null mysql result used by smarty assign_rs |
|
45 | 45 | */ |
46 | 46 | public function rsForSmarty($type, $args = null) |
47 | 47 | { |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * cacheRs executes the database statements for type "cache" |
90 | 90 | * |
91 | 91 | * @param array $args numeric array containing the parameter for "sql_slave" |
92 | - * @return object mysql result used by smarty assign_rs |
|
92 | + * @return mysqli_result mysql result used by smarty assign_rs |
|
93 | 93 | */ |
94 | 94 | private function cacheRs($args = null) |
95 | 95 | { |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * eventRs executes the database statements for type "event" |
144 | 144 | * |
145 | 145 | * @param array $args numeric array containing the parameter for "sql_slave" |
146 | - * @return object mysql result used by smarty assign_rs |
|
146 | + * @return mysqli_result mysql result used by smarty assign_rs |
|
147 | 147 | */ |
148 | 148 | private function eventRs($args = null) |
149 | 149 | { |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | * ratingRs executes the database statements for type "rating" |
216 | 216 | * |
217 | 217 | * @param array $args numeric array containing the parameter for "sql_slave" |
218 | - * @return object mysql result used by smarty assign_rs |
|
218 | + * @return mysqli_result mysql result used by smarty assign_rs |
|
219 | 219 | */ |
220 | 220 | private function ratingRs($args = null) |
221 | 221 | { |
@@ -147,11 +147,17 @@ discard block |
||
147 | 147 | } |
148 | 148 | } |
149 | 149 | |
150 | + /** |
|
151 | + * @param integer $zoom |
|
152 | + */ |
|
150 | 153 | private function lonToTile($long, $zoom) |
151 | 154 | { |
152 | 155 | return (($long + 180) / 360) * (2 ** $zoom); |
153 | 156 | } |
154 | 157 | |
158 | + /** |
|
159 | + * @param integer $zoom |
|
160 | + */ |
|
155 | 161 | private function latToTile($lat, $zoom) |
156 | 162 | { |
157 | 163 | return (1 - log(tan($lat * M_PI / 180) + 1 / cos($lat * M_PI / 180)) / M_PI) / 2 * (2 ** $zoom); |
@@ -247,6 +253,10 @@ discard block |
||
247 | 253 | } |
248 | 254 | } |
249 | 255 | |
256 | + /** |
|
257 | + * @param string $pathname |
|
258 | + * @param integer $mode |
|
259 | + */ |
|
250 | 260 | private function mkdirRecursive($pathname, $mode): bool |
251 | 261 | { |
252 | 262 | is_dir(dirname($pathname)) || $this->mkdirRecursive(dirname($pathname), $mode); |
@@ -254,6 +264,9 @@ discard block |
||
254 | 264 | return is_dir($pathname) || mkdir($pathname, $mode) || is_dir($pathname); |
255 | 265 | } |
256 | 266 | |
267 | + /** |
|
268 | + * @param string $data |
|
269 | + */ |
|
257 | 270 | private function writeTileToCache($url, $data): void |
258 | 271 | { |
259 | 272 | $filename = $this->tileUrlToFilename($url); |
@@ -261,6 +274,9 @@ discard block |
||
261 | 274 | file_put_contents($filename, $data); |
262 | 275 | } |
263 | 276 | |
277 | + /** |
|
278 | + * @param string $url |
|
279 | + */ |
|
264 | 280 | private function fetchTile($url) |
265 | 281 | { |
266 | 282 | if ($this->useTileCache && $cached = $this->checkTileCache($url)) { |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | /** |
58 | 58 | * @var string |
59 | 59 | */ |
60 | - private $tileCacheBaseDir = __DIR__ . '/../../../var/cache2/staticmap'; |
|
60 | + private $tileCacheBaseDir = __DIR__ . '/../../../var/cache2/staticmap'; |
|
61 | 61 | |
62 | 62 | /** |
63 | 63 | * @var int |
@@ -127,11 +127,11 @@ discard block |
||
127 | 127 | |
128 | 128 | if (isset($_GET['size']) && !empty($_GET['size'])) { |
129 | 129 | list($this->width, $this->height) = explode('x', $_GET['size']); |
130 | - $this->width = (int) $this->width; |
|
130 | + $this->width = (int)$this->width; |
|
131 | 131 | if ($this->width > $this->maxWidth) { |
132 | 132 | $this->width = $this->maxWidth; |
133 | 133 | } |
134 | - $this->height = (int) $this->height; |
|
134 | + $this->height = (int)$this->height; |
|
135 | 135 | if ($this->height > $this->maxHeight) { |
136 | 136 | $this->height = $this->maxHeight; |
137 | 137 | } |
@@ -133,6 +133,9 @@ |
||
133 | 133 | sql_free_result($rs); |
134 | 134 | } |
135 | 135 | |
136 | + /** |
|
137 | + * @param string $comment |
|
138 | + */ |
|
136 | 139 | public function archiveCache($cache_id, $comment, $months = 0): void |
137 | 140 | { |
138 | 141 | global $login, $translate; |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | |
292 | 292 | /** |
293 | 293 | * @param int $id |
294 | - * @param $name |
|
294 | + * @param string $name |
|
295 | 295 | */ |
296 | 296 | public function checkGeoKretType($id, $name): void |
297 | 297 | { |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | |
305 | 305 | /** |
306 | 306 | * @param int $id |
307 | - * @param $name |
|
307 | + * @param string $name |
|
308 | 308 | */ |
309 | 309 | public function checkUser($id, $name): void |
310 | 310 | { |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | |
318 | 318 | /** |
319 | 319 | * @param int $id |
320 | - * @param $name |
|
320 | + * @param string $name |
|
321 | 321 | */ |
322 | 322 | public function checkMoveType($id, $name): void |
323 | 323 | { |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $databaseArray |
76 | 76 | ); |
77 | 77 | |
78 | - $entity->id = (int) $this->connection->lastInsertId(); |
|
78 | + $entity->id = (int)$this->connection->lastInsertId(); |
|
79 | 79 | |
80 | 80 | return $entity; |
81 | 81 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | ['id' => $entity->id] |
100 | 100 | ); |
101 | 101 | |
102 | - $entity->id = (int) $this->connection->lastInsertId(); |
|
102 | + $entity->id = (int)$this->connection->lastInsertId(); |
|
103 | 103 | |
104 | 104 | return $entity; |
105 | 105 | } |
@@ -147,13 +147,13 @@ discard block |
||
147 | 147 | public function getEntityFromDatabaseArray(array $data): PageEntity |
148 | 148 | { |
149 | 149 | $entity = new PageEntity(); |
150 | - $entity->id = (int) $data['id']; |
|
150 | + $entity->id = (int)$data['id']; |
|
151 | 151 | $entity->slug = $data['slug']; |
152 | 152 | $entity->metaKeywords = $data['meta_keywords']; |
153 | 153 | $entity->metaDescription = $data['meta_description']; |
154 | 154 | $entity->metaSocial = $data['meta_social']; |
155 | 155 | $entity->updatedAt = new DateTime($data['updated_at']); |
156 | - $entity->active = (bool) $data['active']; |
|
156 | + $entity->active = (bool)$data['active']; |
|
157 | 157 | |
158 | 158 | return $entity; |
159 | 159 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $databaseArray |
84 | 84 | ); |
85 | 85 | |
86 | - $entity->id = (int) $this->connection->lastInsertId(); |
|
86 | + $entity->id = (int)$this->connection->lastInsertId(); |
|
87 | 87 | |
88 | 88 | return $entity; |
89 | 89 | } |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | ['id' => $entity->id] |
108 | 108 | ); |
109 | 109 | |
110 | - $entity->id = (int) $this->connection->lastInsertId(); |
|
110 | + $entity->id = (int)$this->connection->lastInsertId(); |
|
111 | 111 | |
112 | 112 | return $entity; |
113 | 113 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | 'page_id' => $entity->pageId, |
144 | 144 | 'title' => $entity->title, |
145 | 145 | 'html' => $entity->html, |
146 | - 'position' => (int) $entity->position, |
|
146 | + 'position' => (int)$entity->position, |
|
147 | 147 | 'updated_at' => $entity->updatedAt->format(DateTime::ATOM), |
148 | 148 | 'active' => $entity->active, |
149 | 149 | ]; |
@@ -155,13 +155,13 @@ discard block |
||
155 | 155 | public function getEntityFromDatabaseArray(array $data): BlockEntity |
156 | 156 | { |
157 | 157 | $entity = new BlockEntity(); |
158 | - $entity->id = (int) $data['id']; |
|
159 | - $entity->pageId = (int) $data['page_id']; |
|
158 | + $entity->id = (int)$data['id']; |
|
159 | + $entity->pageId = (int)$data['page_id']; |
|
160 | 160 | $entity->title = $data['title']; |
161 | 161 | $entity->html = $data['html']; |
162 | - $entity->position = (int) $data['position']; |
|
162 | + $entity->position = (int)$data['position']; |
|
163 | 163 | $entity->updatedAt = new DateTime($data['updated_at']); |
164 | - $entity->active = (bool) $data['active']; |
|
164 | + $entity->active = (bool)$data['active']; |
|
165 | 165 | |
166 | 166 | return $entity; |
167 | 167 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | { |
56 | 56 | $options = array_merge($this->defaultOptions, $options); |
57 | 57 | |
58 | - $childrenClass = (array) $item->getChildrenAttribute('class'); |
|
58 | + $childrenClass = (array)$item->getChildrenAttribute('class'); |
|
59 | 59 | |
60 | 60 | if ($options['listClass']) { |
61 | 61 | $childrenClass[] = $options['listClass']; |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | } |
138 | 138 | |
139 | 139 | // create an array than can be imploded as a class list |
140 | - $class = (array) $item->getAttribute('class'); |
|
140 | + $class = (array)$item->getAttribute('class'); |
|
141 | 141 | |
142 | 142 | if ($options['itemClass']) { |
143 | 143 | $class[] = $options['itemClass']; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $html .= $this->renderLink($item, $options); |
179 | 179 | |
180 | 180 | // renders the embedded ul |
181 | - $childrenClass = (array) $item->getChildrenAttribute('class'); |
|
181 | + $childrenClass = (array)$item->getChildrenAttribute('class'); |
|
182 | 182 | if ($options['listClass']) { |
183 | 183 | $childrenClass[] = $options['listClass']; |
184 | 184 | } |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | |
220 | 220 | protected function renderLinkElement(ItemInterface $item, array $options): string |
221 | 221 | { |
222 | - $childrenClass = (array) $item->getChildrenAttribute('class'); |
|
222 | + $childrenClass = (array)$item->getChildrenAttribute('class'); |
|
223 | 223 | |
224 | 224 | if ($options['linkClass']) { |
225 | 225 | $childrenClass[] = $options['linkClass']; |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | |
234 | 234 | protected function renderSpanElement(ItemInterface $item, array $options): string |
235 | 235 | { |
236 | - $childrenClass = (array) $item->getChildrenAttribute('class'); |
|
236 | + $childrenClass = (array)$item->getChildrenAttribute('class'); |
|
237 | 237 | |
238 | 238 | if ($options['textClass']) { |
239 | 239 | $childrenClass[] = $options['textClass']; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $databaseArray |
94 | 94 | ); |
95 | 95 | |
96 | - $entity->id = (int) $this->connection->lastInsertId(); |
|
96 | + $entity->id = (int)$this->connection->lastInsertId(); |
|
97 | 97 | |
98 | 98 | return $entity; |
99 | 99 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | ['id' => $entity->id] |
118 | 118 | ); |
119 | 119 | |
120 | - $entity->id = (int) $this->connection->lastInsertId(); |
|
120 | + $entity->id = (int)$this->connection->lastInsertId(); |
|
121 | 121 | |
122 | 122 | return $entity; |
123 | 123 | } |
@@ -189,13 +189,13 @@ discard block |
||
189 | 189 | public function getEntityFromDatabaseArray(array $data): UserEntity |
190 | 190 | { |
191 | 191 | $entity = new UserEntity(); |
192 | - $entity->id = (int) $data['user_id']; |
|
192 | + $entity->id = (int)$data['user_id']; |
|
193 | 193 | $entity->username = $data['username']; |
194 | 194 | $entity->password = $data['password']; |
195 | 195 | $entity->email = $data['email']; |
196 | - $entity->latitude = (double) $data['latitude']; |
|
197 | - $entity->longitude = (double) $data['longitude']; |
|
198 | - $entity->isActive = (bool) $data['is_active_flag']; |
|
196 | + $entity->latitude = (double)$data['latitude']; |
|
197 | + $entity->longitude = (double)$data['longitude']; |
|
198 | + $entity->isActive = (bool)$data['is_active_flag']; |
|
199 | 199 | $entity->firstname = $data['first_name']; |
200 | 200 | $entity->lastname = $data['last_name']; |
201 | 201 | $entity->country = $data['country']; |
@@ -56,7 +56,7 @@ |
||
56 | 56 | |
57 | 57 | public function fromCsvArray(array $data): self |
58 | 58 | { |
59 | - $this->identifier = (int) $data['Identifier']; |
|
59 | + $this->identifier = (int)$data['Identifier']; |
|
60 | 60 | $this->sourceString = $data['SourceString']; |
61 | 61 | $this->comment = $data['Comment']; |
62 | 62 | $this->de = $data['DE']; |