@@ -42,10 +42,10 @@ |
||
| 42 | 42 | * @see DokuWiki_Admin_Plugin::handle() |
| 43 | 43 | */ |
| 44 | 44 | public function handle(): void { |
| 45 | - if(isset ($_REQUEST ['purgeindex'])) { |
|
| 45 | + if (isset ($_REQUEST ['purgeindex'])) { |
|
| 46 | 46 | global $conf; |
| 47 | 47 | $path = $conf ['indexdir'] . '/spatial.idx'; |
| 48 | - if(file_exists($path) && unlink($path)) { |
|
| 48 | + if (file_exists($path) && unlink($path)) { |
|
| 49 | 49 | msg($this->getLang('admin_purged_tiles'), 0); |
| 50 | 50 | } |
| 51 | 51 | } |
@@ -262,11 +262,11 @@ |
||
| 262 | 262 | */ |
| 263 | 263 | private function printHTML(array $searchresults, bool $showMedia = true): void |
| 264 | 264 | { |
| 265 | - $pages = (array)($searchresults ['pages']); |
|
| 266 | - $media = (array)$searchresults ['media']; |
|
| 267 | - $lat = (float)$searchresults ['lat']; |
|
| 268 | - $lon = (float)$searchresults ['lon']; |
|
| 269 | - $geohash = (string)$searchresults ['geohash']; |
|
| 265 | + $pages = ( array ) ($searchresults ['pages']); |
|
| 266 | + $media = ( array ) $searchresults ['media']; |
|
| 267 | + $lat = ( float ) $searchresults ['lat']; |
|
| 268 | + $lon = ( float ) $searchresults ['lon']; |
|
| 269 | + $geohash = ( string ) $searchresults ['geohash']; |
|
| 270 | 270 | |
| 271 | 271 | if (isset ($searchresults ['error'])) { |
| 272 | 272 | print '<div class="level1"><p>' . hsc($searchresults ['error']) . '</p></div>'; |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | ); |
| 155 | 155 | $media [] = array( |
| 156 | 156 | 'id' => $id, |
| 157 | - 'distance' => (int)($line->greatCircleLength()), |
|
| 157 | + 'distance' => ( int ) ($line->greatCircleLength()), |
|
| 158 | 158 | 'lat' => $point->y(), |
| 159 | 159 | 'lon' => $point->x() |
| 160 | 160 | // optionally add other meta such as tag, description... |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | ); |
| 173 | 173 | $pages [] = array( |
| 174 | 174 | 'id' => $id, |
| 175 | - 'distance' => (int)($line->greatCircleLength()), |
|
| 175 | + 'distance' => ( int ) ($line->greatCircleLength()), |
|
| 176 | 176 | 'description' => p_get_metadata($id, 'description')['abstract'], |
| 177 | 177 | 'lat' => $geotags ['lat'], |
| 178 | 178 | 'lon' => $geotags ['lon'] |
@@ -184,12 +184,12 @@ discard block |
||
| 184 | 184 | |
| 185 | 185 | // sort all the pages/media using distance |
| 186 | 186 | usort( |
| 187 | - $pages, static function ($a, $b) { |
|
| 187 | + $pages, static function($a, $b) { |
|
| 188 | 188 | return strnatcmp($a ['distance'], $b ['distance']); |
| 189 | 189 | } |
| 190 | 190 | ); |
| 191 | 191 | usort( |
| 192 | - $media, static function ($a, $b) { |
|
| 192 | + $media, static function($a, $b) { |
|
| 193 | 193 | return strnatcmp($a ['distance'], $b ['distance']); |
| 194 | 194 | } |
| 195 | 195 | ); |
@@ -292,10 +292,10 @@ |
||
| 292 | 292 | { |
| 293 | 293 | // rational64u |
| 294 | 294 | $nums = explode('/', $param); |
| 295 | - if ((int)$nums[1] > 0) { |
|
| 296 | - return (float)$nums[0] / (int)$nums[1]; |
|
| 295 | + if (( int ) $nums[1] > 0) { |
|
| 296 | + return ( float ) $nums[0] / ( int ) $nums[1]; |
|
| 297 | 297 | } else { |
| 298 | - return (float)$nums[0]; |
|
| 298 | + return ( float ) $nums[0]; |
|
| 299 | 299 | } |
| 300 | 300 | } |
| 301 | 301 | |