@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $xmlObject->preserveWhiteSpace = false; |
| 66 | 66 | @$xmlObject->loadXML($gpx); |
| 67 | 67 | if ($xmlObject === false) { |
| 68 | - throw new \Exception("Invalid GPX: " . $gpx); |
|
| 68 | + throw new \Exception("Invalid GPX: ".$gpx); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | $this->parseGarminRpt = strpos($gpx, 'gpxx:rpt') > 0; |
@@ -88,8 +88,8 @@ discard block |
||
| 88 | 88 | if ($caller && $caller !== __FUNCTION__) { |
| 89 | 89 | $gpx = preg_replace_callback( |
| 90 | 90 | "/(<\/?\w+)(.*?>)/", |
| 91 | - function ($m) { |
|
| 92 | - return strtolower($m[1]) . $m[2]; |
|
| 91 | + function($m) { |
|
| 92 | + return strtolower($m[1]).$m[2]; |
|
| 93 | 93 | }, |
| 94 | 94 | $gpx |
| 95 | 95 | ); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | } catch (\Exception $e) { |
| 100 | - throw new \Exception("Cannot Read Geometry From GPX: " . $gpx); |
|
| 100 | + throw new \Exception("Cannot Read Geometry From GPX: ".$gpx); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | return $geom; |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $elevation = $ele->item(0)->nodeValue; |
| 165 | 165 | } |
| 166 | 166 | $point = new Point($lon, $lat, $elevation); |
| 167 | - $point->setData($this->parseNodeProperties($node, $this->gpxTypes->get($node->nodeName . 'Type'))); |
|
| 167 | + $point->setData($this->parseNodeProperties($node, $this->gpxTypes->get($node->nodeName.'Type'))); |
|
| 168 | 168 | if ($node->nodeName === 'rtept' && $this->parseGarminRpt) { |
| 169 | 169 | foreach ($this->xpath->query('.//gpx:extensions/gpxx:RoutePointExtension/gpxx:rpt', $node) as $element) { |
| 170 | 170 | $this->trackFromRoute[] = $this->parsePoint($element); |
@@ -317,19 +317,19 @@ discard block |
||
| 317 | 317 | public function write(Geometry $geometry, $namespace = null, $allowedElements = null) |
| 318 | 318 | { |
| 319 | 319 | if ($namespace) { |
| 320 | - $this->nss = $namespace . ':'; |
|
| 320 | + $this->nss = $namespace.':'; |
|
| 321 | 321 | } |
| 322 | 322 | $this->gpxTypes = new GpxTypes($allowedElements); |
| 323 | 323 | |
| 324 | 324 | return |
| 325 | 325 | '<?xml version="1.0" encoding="UTF-8"?> |
| 326 | -<' . $this->nss . 'gpx creator="geoPHP" version="1.1" |
|
| 326 | +<' . $this->nss.'gpx creator="geoPHP" version="1.1" |
|
| 327 | 327 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 328 | 328 | xmlns="http://www.topografix.com/GPX/1/1" |
| 329 | 329 | xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" > |
| 330 | 330 | |
| 331 | -' . $this->geometryToGPX($geometry) . |
|
| 332 | - '</' . $this->nss . 'gpx> |
|
| 331 | +' . $this->geometryToGPX($geometry). |
|
| 332 | + '</'.$this->nss.'gpx> |
|
| 333 | 333 | '; |
| 334 | 334 | } |
| 335 | 335 | |
@@ -369,18 +369,18 @@ discard block |
||
| 369 | 369 | $indent = $tag === 'trkpt' ? "\t\t" : ($tag === 'rtept' ? "\t" : ''); |
| 370 | 370 | |
| 371 | 371 | if ($geom->hasZ() || $geom->getData() !== null) { |
| 372 | - $node = $indent . "<" . $this->nss . $tag . " lat=\"" . $geom->getY() . "\" lon=\"" . $geom->getX() . "\">\n"; |
|
| 372 | + $node = $indent."<".$this->nss.$tag." lat=\"".$geom->getY()."\" lon=\"".$geom->getX()."\">\n"; |
|
| 373 | 373 | if ($geom->hasZ()) { |
| 374 | 374 | $geom->setData('ele', $geom->z()); |
| 375 | 375 | } |
| 376 | - $node .= self::processGeometryData($geom, $this->gpxTypes->get($tag . 'Type'), $indent . "\t") . |
|
| 377 | - $indent . "</" . $this->nss . $tag . ">\n"; |
|
| 376 | + $node .= self::processGeometryData($geom, $this->gpxTypes->get($tag.'Type'), $indent."\t"). |
|
| 377 | + $indent."</".$this->nss.$tag.">\n"; |
|
| 378 | 378 | if ($geom->hasZ()) { |
| 379 | 379 | $geom->setData('ele', null); |
| 380 | 380 | } |
| 381 | 381 | return $node; |
| 382 | 382 | } |
| 383 | - return $indent . "<" . $this->nss . $tag . " lat=\"" . $geom->getY() . "\" lon=\"" . $geom->getX() . "\" />\n"; |
|
| 383 | + return $indent."<".$this->nss.$tag." lat=\"".$geom->getY()."\" lon=\"".$geom->getX()."\" />\n"; |
|
| 384 | 384 | } |
| 385 | 385 | |
| 386 | 386 | /** |
@@ -402,26 +402,26 @@ discard block |
||
| 402 | 402 | if ($isTrack) { // write as <trk> |
| 403 | 403 | |
| 404 | 404 | /** @noinspection SpellCheckingInspection */ |
| 405 | - $gpx = "<" . $this->nss . "trk>\n" . self::processGeometryData($geom, $this->gpxTypes->get('trkType')); |
|
| 405 | + $gpx = "<".$this->nss."trk>\n".self::processGeometryData($geom, $this->gpxTypes->get('trkType')); |
|
| 406 | 406 | $components = $geom->geometryType() === 'LineString' ? [$geom] : $geom->getComponents(); |
| 407 | 407 | foreach ($components as $lineString) { |
| 408 | - $gpx .= "\t<" . $this->nss . "trkseg>\n"; |
|
| 408 | + $gpx .= "\t<".$this->nss."trkseg>\n"; |
|
| 409 | 409 | foreach ($lineString->getPoints() as $point) { |
| 410 | 410 | $gpx .= $this->pointToGPX($point, 'trkpt'); |
| 411 | 411 | } |
| 412 | - $gpx .= "\t</" . $this->nss . "trkseg>\n"; |
|
| 412 | + $gpx .= "\t</".$this->nss."trkseg>\n"; |
|
| 413 | 413 | } |
| 414 | 414 | /** @noinspection SpellCheckingInspection */ |
| 415 | - $gpx .= "</" . $this->nss . "trk>\n"; |
|
| 415 | + $gpx .= "</".$this->nss."trk>\n"; |
|
| 416 | 416 | } else { // write as <rte> |
| 417 | 417 | |
| 418 | 418 | /** @noinspection SpellCheckingInspection */ |
| 419 | - $gpx = "<" . $this->nss . "rte>\n" . self::processGeometryData($geom, $this->gpxTypes->get('rteType')); |
|
| 419 | + $gpx = "<".$this->nss."rte>\n".self::processGeometryData($geom, $this->gpxTypes->get('rteType')); |
|
| 420 | 420 | foreach ($geom->getPoints() as $point) { |
| 421 | 421 | $gpx .= $this->pointToGPX($point, 'rtept'); |
| 422 | 422 | } |
| 423 | 423 | /** @noinspection SpellCheckingInspection */ |
| 424 | - $gpx .= "</" . $this->nss . "rte>\n"; |
|
| 424 | + $gpx .= "</".$this->nss."rte>\n"; |
|
| 425 | 425 | } |
| 426 | 426 | |
| 427 | 427 | return $gpx; |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | } |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | - return $metadata . $wayPoints . $routes . $tracks; |
|
| 457 | + return $metadata.$wayPoints.$routes.$tracks; |
|
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | /** |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | if ($geometry->getData() !== null) { |
| 470 | 470 | foreach ($tagList as $tagName) { |
| 471 | 471 | if ($geometry->hasDataProperty($tagName)) { |
| 472 | - $tags .= self::createNodes($tagName, $geometry->getData($tagName), $indent) . "\n"; |
|
| 472 | + $tags .= self::createNodes($tagName, $geometry->getData($tagName), $indent)."\n"; |
|
| 473 | 473 | } |
| 474 | 474 | } |
| 475 | 475 | } |
@@ -492,14 +492,14 @@ discard block |
||
| 492 | 492 | if (array_key_exists('@attributes', $value)) { |
| 493 | 493 | $attributes = ''; |
| 494 | 494 | foreach ($value['@attributes'] as $attributeName => $attributeValue) { |
| 495 | - $attributes .= ' ' . $attributeName . '="' . $attributeValue . '"'; |
|
| 495 | + $attributes .= ' '.$attributeName.'="'.$attributeValue.'"'; |
|
| 496 | 496 | } |
| 497 | 497 | unset($value['@attributes']); |
| 498 | 498 | } |
| 499 | 499 | foreach ($value as $subKey => $subValue) { |
| 500 | - $returnValue .= "\n" . self::createNodes($subKey, $subValue, $indent . "\t") . "\n" . $indent; |
|
| 500 | + $returnValue .= "\n".self::createNodes($subKey, $subValue, $indent."\t")."\n".$indent; |
|
| 501 | 501 | } |
| 502 | 502 | } |
| 503 | - return $indent . "<{$tagName}{$attributes}>{$returnValue}</{$tagName}>"; |
|
| 503 | + return $indent."<{$tagName}{$attributes}>{$returnValue}</{$tagName}>"; |
|
| 504 | 504 | } |
| 505 | 505 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | /** |
| 52 | 52 | * @var array Same as wptType |
| 53 | 53 | */ |
| 54 | - public static $trkptTypeElements = [ // same as wptTypeElements |
|
| 54 | + public static $trkptTypeElements = [// same as wptTypeElements |
|
| 55 | 55 | 'ele', 'time', 'magvar', 'geoidheight', 'name', 'cmt', 'desc', 'src', 'link', 'sym', 'type', |
| 56 | 56 | 'fix', 'sat', 'hdop', 'vdop', 'pdop', 'ageofdgpsdata', 'dgpsid' |
| 57 | 57 | ]; |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | /** |
| 60 | 60 | * @var array Same as wptType |
| 61 | 61 | */ |
| 62 | - public static $rteptTypeElements = [ // same as wptTypeElements |
|
| 62 | + public static $rteptTypeElements = [// same as wptTypeElements |
|
| 63 | 63 | 'ele', 'time', 'magvar', 'geoidheight', 'name', 'cmt', 'desc', 'src', 'link', 'sym', 'type', |
| 64 | 64 | 'fix', 'sat', 'hdop', 'vdop', 'pdop', 'ageofdgpsdata', 'dgpsid' |
| 65 | 65 | ]; |
@@ -107,10 +107,10 @@ discard block |
||
| 107 | 107 | if (is_array($allowedElements)) { |
| 108 | 108 | foreach ($allowedElements as $type => $elements) { |
| 109 | 109 | $elements = is_array($elements) ? $elements : [$elements]; |
| 110 | - $this->{'allowed' . ucfirst($type) . 'Elements'} = []; |
|
| 111 | - foreach ($this::${$type . 'Elements'} as $availableType) { |
|
| 110 | + $this->{'allowed'.ucfirst($type).'Elements'} = []; |
|
| 111 | + foreach ($this::${$type.'Elements'} as $availableType) { |
|
| 112 | 112 | if (in_array($availableType, $elements)) { |
| 113 | - $this->{'allowed' . ucfirst($type) . 'Elements'}[] = $availableType; |
|
| 113 | + $this->{'allowed'.ucfirst($type).'Elements'}[] = $availableType; |
|
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | public function get($type) |
| 128 | 128 | { |
| 129 | - $propertyName = 'allowed' . ucfirst($type) . 'Elements'; |
|
| 129 | + $propertyName = 'allowed'.ucfirst($type).'Elements'; |
|
| 130 | 130 | if (isset($this->{$propertyName})) { |
| 131 | 131 | return $this->{$propertyName}; |
| 132 | 132 | } |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | if (empty($wkb)) { |
| 90 | - throw new \Exception('Cannot read empty WKB geometry. Found ' . gettype($wkb)); |
|
| 90 | + throw new \Exception('Cannot read empty WKB geometry. Found '.gettype($wkb)); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | $this->reader = new BinaryReader($wkb); |
@@ -115,29 +115,29 @@ discard block |
||
| 115 | 115 | |
| 116 | 116 | $wkbType = $this->reader->readUInt32(); |
| 117 | 117 | |
| 118 | - if (($wkbType & $this::SRID_MASK) === $this::SRID_MASK) { |
|
| 118 | + if (($wkbType&$this::SRID_MASK) === $this::SRID_MASK) { |
|
| 119 | 119 | $SRID = $this->reader->readUInt32(); |
| 120 | 120 | } |
| 121 | 121 | $geometryType = null; |
| 122 | 122 | if ($wkbType >= 1000 && $wkbType < 2000) { |
| 123 | 123 | $this->hasZ = true; |
| 124 | - $geometryType = $wkbType - 1000; |
|
| 124 | + $geometryType = $wkbType-1000; |
|
| 125 | 125 | } elseif ($wkbType >= 2000 && $wkbType < 3000) { |
| 126 | 126 | $this->hasM = true; |
| 127 | - $geometryType = $wkbType - 2000; |
|
| 127 | + $geometryType = $wkbType-2000; |
|
| 128 | 128 | } elseif ($wkbType >= 3000 && $wkbType < 4000) { |
| 129 | 129 | $this->hasZ = true; |
| 130 | 130 | $this->hasM = true; |
| 131 | - $geometryType = $wkbType - 3000; |
|
| 131 | + $geometryType = $wkbType-3000; |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - if ($wkbType & $this::Z_MASK) { |
|
| 134 | + if ($wkbType&$this::Z_MASK) { |
|
| 135 | 135 | $this->hasZ = true; |
| 136 | 136 | } |
| 137 | - if ($wkbType & $this::M_MASK) { |
|
| 137 | + if ($wkbType&$this::M_MASK) { |
|
| 138 | 138 | $this->hasM = true; |
| 139 | 139 | } |
| 140 | - $this->dimension = 2 + ($this->hasZ ? 1 : 0) + ($this->hasM ? 1 : 0); |
|
| 140 | + $this->dimension = 2+($this->hasZ ? 1 : 0)+($this->hasM ? 1 : 0); |
|
| 141 | 141 | |
| 142 | 142 | if (!$geometryType) { |
| 143 | 143 | $geometryType = $wkbType & 0xF; // remove any masks from type |
@@ -167,8 +167,8 @@ discard block |
||
| 167 | 167 | break; |
| 168 | 168 | default: |
| 169 | 169 | throw new \Exception( |
| 170 | - 'Geometry type ' . $geometryType . |
|
| 171 | - ' (' . (array_search($geometryType, self::$typeMap) ?: 'unknown') . ') not supported' |
|
| 170 | + 'Geometry type '.$geometryType. |
|
| 171 | + ' ('.(array_search($geometryType, self::$typeMap) ?: 'unknown').') not supported' |
|
| 172 | 172 | ); |
| 173 | 173 | } |
| 174 | 174 | if ($geometry && $SRID) { |
@@ -331,9 +331,9 @@ discard block |
||
| 331 | 331 | protected function writePoint($point) |
| 332 | 332 | { |
| 333 | 333 | if ($point->isEmpty()) { |
| 334 | - return $this->writer->writeDouble(NAN) . $this->writer->writeDouble(NAN); |
|
| 334 | + return $this->writer->writeDouble(NAN).$this->writer->writeDouble(NAN); |
|
| 335 | 335 | } |
| 336 | - $wkb = $this->writer->writeDouble($point->x()) . $this->writer->writeDouble($point->y()); |
|
| 336 | + $wkb = $this->writer->writeDouble($point->x()).$this->writer->writeDouble($point->y()); |
|
| 337 | 337 | |
| 338 | 338 | if ($this->hasZ) { |
| 339 | 339 | $wkb .= $this->writer->writeDouble($point->z()); |
@@ -405,15 +405,15 @@ discard block |
||
| 405 | 405 | $type = self::$typeMap[$geometry->geometryType()]; |
| 406 | 406 | // Binary OR to mix in additional properties |
| 407 | 407 | if ($this->hasZ) { |
| 408 | - $type = $type | $this::Z_MASK; |
|
| 408 | + $type = $type|$this::Z_MASK; |
|
| 409 | 409 | } |
| 410 | 410 | if ($this->hasM) { |
| 411 | - $type = $type | $this::M_MASK; |
|
| 411 | + $type = $type|$this::M_MASK; |
|
| 412 | 412 | } |
| 413 | 413 | if ($geometry->SRID() && $writeSRID) { |
| 414 | - $type = $type | $this::SRID_MASK; |
|
| 414 | + $type = $type|$this::SRID_MASK; |
|
| 415 | 415 | } |
| 416 | - return $this->writer->writeUInt32($type) . |
|
| 416 | + return $this->writer->writeUInt32($type). |
|
| 417 | 417 | ($geometry->SRID() && $writeSRID ? $this->writer->writeUInt32($this->SRID) : ''); |
| 418 | 418 | } |
| 419 | 419 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | /** |
| 27 | 27 | * array of neighbouring hash character maps. |
| 28 | 28 | */ |
| 29 | - private static $neighbours = [ |
|
| 29 | + private static $neighbours = [ |
|
| 30 | 30 | // north |
| 31 | 31 | 'top' => [ |
| 32 | 32 | 'even' => 'p0r21436x8zb9dcf5h7kjnmqesgutwvy', |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | /** |
| 53 | 53 | * array of bordering hash character maps. |
| 54 | 54 | */ |
| 55 | - private static $borders = [ |
|
| 55 | + private static $borders = [ |
|
| 56 | 56 | // north |
| 57 | 57 | 'top' => [ |
| 58 | 58 | 'even' => 'prxz', |
@@ -166,9 +166,9 @@ discard block |
||
| 166 | 166 | $hash = ''; |
| 167 | 167 | |
| 168 | 168 | if (!is_numeric($precision)) { |
| 169 | - $lap = strlen($point->y()) - strpos($point->y(), "."); |
|
| 170 | - $lop = strlen($point->x()) - strpos($point->x(), "."); |
|
| 171 | - $precision = pow(10, -max($lap - 1, $lop - 1, 0)) / 2; |
|
| 169 | + $lap = strlen($point->y())-strpos($point->y(), "."); |
|
| 170 | + $lop = strlen($point->x())-strpos($point->x(), "."); |
|
| 171 | + $precision = pow(10, -max($lap-1, $lop-1, 0)) / 2; |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | if ( |
@@ -181,9 +181,9 @@ discard block |
||
| 181 | 181 | while ($error >= $precision) { |
| 182 | 182 | $chr = 0; |
| 183 | 183 | for ($b = 4; $b >= 0; --$b) { |
| 184 | - if ((1 & $b) == (1 & $i)) { |
|
| 184 | + if ((1&$b) == (1&$i)) { |
|
| 185 | 185 | // even char, even bit OR odd char, odd bit...a lon |
| 186 | - $next = ($minLongitude + $maxLongitude) / 2; |
|
| 186 | + $next = ($minLongitude+$maxLongitude) / 2; |
|
| 187 | 187 | if ($point->x() > $next) { |
| 188 | 188 | $chr |= pow(2, $b); |
| 189 | 189 | $minLongitude = $next; |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | $longitudeError /= 2; |
| 194 | 194 | } else { |
| 195 | 195 | // odd char, even bit OR even char, odd bit...a lat |
| 196 | - $next = ($minLatitude + $maxLatitude) / 2; |
|
| 196 | + $next = ($minLatitude+$maxLatitude) / 2; |
|
| 197 | 197 | if ($point->y() > $next) { |
| 198 | 198 | $chr |= pow(2, $b); |
| 199 | 199 | $minLatitude = $next; |
@@ -228,59 +228,59 @@ discard block |
||
| 228 | 228 | $longitudeError = 180; |
| 229 | 229 | for ($i = 0, $c = strlen($hash); $i < $c; $i++) { |
| 230 | 230 | $v = strpos(self::$characterTable, $hash[$i]); |
| 231 | - if (1 & $i) { |
|
| 232 | - if (16 & $v) { |
|
| 233 | - $minLatitude = ($minLatitude + $maxLatitude) / 2; |
|
| 231 | + if (1&$i) { |
|
| 232 | + if (16&$v) { |
|
| 233 | + $minLatitude = ($minLatitude+$maxLatitude) / 2; |
|
| 234 | 234 | } else { |
| 235 | - $maxLatitude = ($minLatitude + $maxLatitude) / 2; |
|
| 235 | + $maxLatitude = ($minLatitude+$maxLatitude) / 2; |
|
| 236 | 236 | } |
| 237 | - if (8 & $v) { |
|
| 238 | - $minLongitude = ($minLongitude + $maxLongitude) / 2; |
|
| 237 | + if (8&$v) { |
|
| 238 | + $minLongitude = ($minLongitude+$maxLongitude) / 2; |
|
| 239 | 239 | } else { |
| 240 | - $maxLongitude = ($minLongitude + $maxLongitude) / 2; |
|
| 240 | + $maxLongitude = ($minLongitude+$maxLongitude) / 2; |
|
| 241 | 241 | } |
| 242 | - if (4 & $v) { |
|
| 243 | - $minLatitude = ($minLatitude + $maxLatitude) / 2; |
|
| 242 | + if (4&$v) { |
|
| 243 | + $minLatitude = ($minLatitude+$maxLatitude) / 2; |
|
| 244 | 244 | } else { |
| 245 | - $maxLatitude = ($minLatitude + $maxLatitude) / 2; |
|
| 245 | + $maxLatitude = ($minLatitude+$maxLatitude) / 2; |
|
| 246 | 246 | } |
| 247 | - if (2 & $v) { |
|
| 248 | - $minLongitude = ($minLongitude + $maxLongitude) / 2; |
|
| 247 | + if (2&$v) { |
|
| 248 | + $minLongitude = ($minLongitude+$maxLongitude) / 2; |
|
| 249 | 249 | } else { |
| 250 | - $maxLongitude = ($minLongitude + $maxLongitude) / 2; |
|
| 250 | + $maxLongitude = ($minLongitude+$maxLongitude) / 2; |
|
| 251 | 251 | } |
| 252 | - if (1 & $v) { |
|
| 253 | - $minLatitude = ($minLatitude + $maxLatitude) / 2; |
|
| 252 | + if (1&$v) { |
|
| 253 | + $minLatitude = ($minLatitude+$maxLatitude) / 2; |
|
| 254 | 254 | } else { |
| 255 | - $maxLatitude = ($minLatitude + $maxLatitude) / 2; |
|
| 255 | + $maxLatitude = ($minLatitude+$maxLatitude) / 2; |
|
| 256 | 256 | } |
| 257 | 257 | $latitudeError /= 8; |
| 258 | 258 | $longitudeError /= 4; |
| 259 | 259 | } else { |
| 260 | - if (16 & $v) { |
|
| 261 | - $minLongitude = ($minLongitude + $maxLongitude) / 2; |
|
| 260 | + if (16&$v) { |
|
| 261 | + $minLongitude = ($minLongitude+$maxLongitude) / 2; |
|
| 262 | 262 | } else { |
| 263 | - $maxLongitude = ($minLongitude + $maxLongitude) / 2; |
|
| 263 | + $maxLongitude = ($minLongitude+$maxLongitude) / 2; |
|
| 264 | 264 | } |
| 265 | - if (8 & $v) { |
|
| 266 | - $minLatitude = ($minLatitude + $maxLatitude) / 2; |
|
| 265 | + if (8&$v) { |
|
| 266 | + $minLatitude = ($minLatitude+$maxLatitude) / 2; |
|
| 267 | 267 | } else { |
| 268 | - $maxLatitude = ($minLatitude + $maxLatitude) / 2; |
|
| 268 | + $maxLatitude = ($minLatitude+$maxLatitude) / 2; |
|
| 269 | 269 | } |
| 270 | - if (4 & $v) { |
|
| 271 | - $minLongitude = ($minLongitude + $maxLongitude) / 2; |
|
| 270 | + if (4&$v) { |
|
| 271 | + $minLongitude = ($minLongitude+$maxLongitude) / 2; |
|
| 272 | 272 | } else { |
| 273 | - $maxLongitude = ($minLongitude + $maxLongitude) / 2; |
|
| 273 | + $maxLongitude = ($minLongitude+$maxLongitude) / 2; |
|
| 274 | 274 | } |
| 275 | - if (2 & $v) { |
|
| 276 | - $minLatitude = ($minLatitude + $maxLatitude) / 2; |
|
| 275 | + if (2&$v) { |
|
| 276 | + $minLatitude = ($minLatitude+$maxLatitude) / 2; |
|
| 277 | 277 | } else { |
| 278 | - $maxLatitude = ($minLatitude + $maxLatitude) / 2; |
|
| 278 | + $maxLatitude = ($minLatitude+$maxLatitude) / 2; |
|
| 279 | 279 | } |
| 280 | - if (1 & $v) { |
|
| 281 | - $minLongitude = ($minLongitude + $maxLongitude) / 2; |
|
| 280 | + if (1&$v) { |
|
| 281 | + $minLongitude = ($minLongitude+$maxLongitude) / 2; |
|
| 282 | 282 | } else { |
| 283 | - $maxLongitude = ($minLongitude + $maxLongitude) / 2; |
|
| 283 | + $maxLongitude = ($minLongitude+$maxLongitude) / 2; |
|
| 284 | 284 | } |
| 285 | 285 | $latitudeError /= 4; |
| 286 | 286 | $longitudeError /= 8; |
@@ -290,8 +290,8 @@ discard block |
||
| 290 | 290 | $result['minLongitude'] = $minLongitude; |
| 291 | 291 | $result['maxLatitude'] = $maxLatitude; |
| 292 | 292 | $result['maxLongitude'] = $maxLongitude; |
| 293 | - $result['centerLatitude'] = round(($minLatitude + $maxLatitude) / 2, max(1, -round(log10($latitudeError))) - 1); |
|
| 294 | - $result['centerLongitude'] = round(($minLongitude + $maxLongitude) / 2, max(1, -round(log10($longitudeError))) - 1); |
|
| 293 | + $result['centerLatitude'] = round(($minLatitude+$maxLatitude) / 2, max(1, -round(log10($latitudeError)))-1); |
|
| 294 | + $result['centerLongitude'] = round(($minLongitude+$maxLongitude) / 2, max(1, -round(log10($longitudeError)))-1); |
|
| 295 | 295 | return $result; |
| 296 | 296 | } |
| 297 | 297 | |
@@ -316,10 +316,10 @@ discard block |
||
| 316 | 316 | { |
| 317 | 317 | $last = substr($hash, -1); |
| 318 | 318 | $type = (strlen($hash) % 2) ? 'odd' : 'even'; |
| 319 | - $base = substr($hash, 0, strlen($hash) - 1); |
|
| 319 | + $base = substr($hash, 0, strlen($hash)-1); |
|
| 320 | 320 | if (strpos((self::$borders[$direction][$type]), $last) !== false) { |
| 321 | 321 | $base = self::adjacent($base, $direction); |
| 322 | 322 | } |
| 323 | - return $base . self::$characterTable[strpos(self::$neighbours[$direction][$type], $last)]; |
|
| 323 | + return $base.self::$characterTable[strpos(self::$neighbours[$direction][$type], $last)]; |
|
| 324 | 324 | } |
| 325 | 325 | } |
@@ -101,12 +101,12 @@ discard block |
||
| 101 | 101 | $out = ''; |
| 102 | 102 | |
| 103 | 103 | while (($value & 0xFFFFFF80) !== 0) { |
| 104 | - $out .= $this->writeUInt8(($value & 0x7F) | 0x80); |
|
| 104 | + $out .= $this->writeUInt8(($value & 0x7F)|0x80); |
|
| 105 | 105 | // Zero fill by 7 zero |
| 106 | 106 | if ($value >= 0) { |
| 107 | 107 | $value >>= 7; |
| 108 | 108 | } else { |
| 109 | - $value = ((~$value) >> 7) ^ (0x7fffffff >> (7 - 1)); |
|
| 109 | + $value = ((~$value) >> 7)^(0x7fffffff >> (7-1)); |
|
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | |
@@ -133,6 +133,6 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public static function zigZagEncode($value) |
| 135 | 135 | { |
| 136 | - return ($value << 1) ^ ($value >> 31); |
|
| 136 | + return ($value << 1)^($value >> 31); |
|
| 137 | 137 | } |
| 138 | 138 | } |
@@ -2,6 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | // autoload.php @generated by Composer |
| 4 | 4 | |
| 5 | -require_once __DIR__ . '/composer/autoload_real.php'; |
|
| 5 | +require_once __DIR__.'/composer/autoload_real.php'; |
|
| 6 | 6 | |
| 7 | 7 | return ComposerAutoloaderInit8c920a9ce68d92f821701ab2e03316d3::getLoader(); |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | $issues = array(); |
| 6 | 6 | |
| 7 | 7 | if (!(PHP_VERSION_ID >= 70400)) { |
| 8 | - $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.'; |
|
| 8 | + $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running '.PHP_VERSION.'.'; |
|
| 9 | 9 | } |
| 10 | 10 | |
| 11 | 11 | if ($issues) { |
@@ -14,13 +14,13 @@ discard block |
||
| 14 | 14 | } |
| 15 | 15 | if (!ini_get('display_errors')) { |
| 16 | 16 | if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { |
| 17 | - fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); |
|
| 17 | + fwrite(STDERR, 'Composer detected issues in your platform:'.PHP_EOL.PHP_EOL.implode(PHP_EOL, $issues).PHP_EOL.PHP_EOL); |
|
| 18 | 18 | } elseif (!headers_sent()) { |
| 19 | - echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; |
|
| 19 | + echo 'Composer detected issues in your platform:'.PHP_EOL.PHP_EOL.str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)).PHP_EOL.PHP_EOL; |
|
| 20 | 20 | } |
| 21 | 21 | } |
| 22 | 22 | trigger_error( |
| 23 | - 'Composer detected issues in your platform: ' . implode(' ', $issues), |
|
| 23 | + 'Composer detected issues in your platform: '.implode(' ', $issues), |
|
| 24 | 24 | E_USER_ERROR |
| 25 | 25 | ); |
| 26 | 26 | } |
@@ -186,13 +186,13 @@ discard block |
||
| 186 | 186 | if (!$prefix) { |
| 187 | 187 | if ($prepend) { |
| 188 | 188 | $this->fallbackDirsPsr0 = array_merge( |
| 189 | - (array) $paths, |
|
| 189 | + (array)$paths, |
|
| 190 | 190 | $this->fallbackDirsPsr0 |
| 191 | 191 | ); |
| 192 | 192 | } else { |
| 193 | 193 | $this->fallbackDirsPsr0 = array_merge( |
| 194 | 194 | $this->fallbackDirsPsr0, |
| 195 | - (array) $paths |
|
| 195 | + (array)$paths |
|
| 196 | 196 | ); |
| 197 | 197 | } |
| 198 | 198 | |
@@ -201,19 +201,19 @@ discard block |
||
| 201 | 201 | |
| 202 | 202 | $first = $prefix[0]; |
| 203 | 203 | if (!isset($this->prefixesPsr0[$first][$prefix])) { |
| 204 | - $this->prefixesPsr0[$first][$prefix] = (array) $paths; |
|
| 204 | + $this->prefixesPsr0[$first][$prefix] = (array)$paths; |
|
| 205 | 205 | |
| 206 | 206 | return; |
| 207 | 207 | } |
| 208 | 208 | if ($prepend) { |
| 209 | 209 | $this->prefixesPsr0[$first][$prefix] = array_merge( |
| 210 | - (array) $paths, |
|
| 210 | + (array)$paths, |
|
| 211 | 211 | $this->prefixesPsr0[$first][$prefix] |
| 212 | 212 | ); |
| 213 | 213 | } else { |
| 214 | 214 | $this->prefixesPsr0[$first][$prefix] = array_merge( |
| 215 | 215 | $this->prefixesPsr0[$first][$prefix], |
| 216 | - (array) $paths |
|
| 216 | + (array)$paths |
|
| 217 | 217 | ); |
| 218 | 218 | } |
| 219 | 219 | } |
@@ -236,34 +236,34 @@ discard block |
||
| 236 | 236 | // Register directories for the root namespace. |
| 237 | 237 | if ($prepend) { |
| 238 | 238 | $this->fallbackDirsPsr4 = array_merge( |
| 239 | - (array) $paths, |
|
| 239 | + (array)$paths, |
|
| 240 | 240 | $this->fallbackDirsPsr4 |
| 241 | 241 | ); |
| 242 | 242 | } else { |
| 243 | 243 | $this->fallbackDirsPsr4 = array_merge( |
| 244 | 244 | $this->fallbackDirsPsr4, |
| 245 | - (array) $paths |
|
| 245 | + (array)$paths |
|
| 246 | 246 | ); |
| 247 | 247 | } |
| 248 | 248 | } elseif (!isset($this->prefixDirsPsr4[$prefix])) { |
| 249 | 249 | // Register directories for a new namespace. |
| 250 | 250 | $length = strlen($prefix); |
| 251 | - if ('\\' !== $prefix[$length - 1]) { |
|
| 251 | + if ('\\' !== $prefix[$length-1]) { |
|
| 252 | 252 | throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); |
| 253 | 253 | } |
| 254 | 254 | $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; |
| 255 | - $this->prefixDirsPsr4[$prefix] = (array) $paths; |
|
| 255 | + $this->prefixDirsPsr4[$prefix] = (array)$paths; |
|
| 256 | 256 | } elseif ($prepend) { |
| 257 | 257 | // Prepend directories for an already registered namespace. |
| 258 | 258 | $this->prefixDirsPsr4[$prefix] = array_merge( |
| 259 | - (array) $paths, |
|
| 259 | + (array)$paths, |
|
| 260 | 260 | $this->prefixDirsPsr4[$prefix] |
| 261 | 261 | ); |
| 262 | 262 | } else { |
| 263 | 263 | // Append directories for an already registered namespace. |
| 264 | 264 | $this->prefixDirsPsr4[$prefix] = array_merge( |
| 265 | 265 | $this->prefixDirsPsr4[$prefix], |
| 266 | - (array) $paths |
|
| 266 | + (array)$paths |
|
| 267 | 267 | ); |
| 268 | 268 | } |
| 269 | 269 | } |
@@ -280,9 +280,9 @@ discard block |
||
| 280 | 280 | public function set($prefix, $paths) |
| 281 | 281 | { |
| 282 | 282 | if (!$prefix) { |
| 283 | - $this->fallbackDirsPsr0 = (array) $paths; |
|
| 283 | + $this->fallbackDirsPsr0 = (array)$paths; |
|
| 284 | 284 | } else { |
| 285 | - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; |
|
| 285 | + $this->prefixesPsr0[$prefix[0]][$prefix] = (array)$paths; |
|
| 286 | 286 | } |
| 287 | 287 | } |
| 288 | 288 | |
@@ -300,14 +300,14 @@ discard block |
||
| 300 | 300 | public function setPsr4($prefix, $paths) |
| 301 | 301 | { |
| 302 | 302 | if (!$prefix) { |
| 303 | - $this->fallbackDirsPsr4 = (array) $paths; |
|
| 303 | + $this->fallbackDirsPsr4 = (array)$paths; |
|
| 304 | 304 | } else { |
| 305 | 305 | $length = strlen($prefix); |
| 306 | - if ('\\' !== $prefix[$length - 1]) { |
|
| 306 | + if ('\\' !== $prefix[$length-1]) { |
|
| 307 | 307 | throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); |
| 308 | 308 | } |
| 309 | 309 | $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; |
| 310 | - $this->prefixDirsPsr4[$prefix] = (array) $paths; |
|
| 310 | + $this->prefixDirsPsr4[$prefix] = (array)$paths; |
|
| 311 | 311 | } |
| 312 | 312 | } |
| 313 | 313 | |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | if ($prepend) { |
| 398 | - self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; |
|
| 398 | + self::$registeredLoaders = array($this->vendorDir => $this)+self::$registeredLoaders; |
|
| 399 | 399 | } else { |
| 400 | 400 | unset(self::$registeredLoaders[$this->vendorDir]); |
| 401 | 401 | self::$registeredLoaders[$this->vendorDir] = $this; |
@@ -493,18 +493,18 @@ discard block |
||
| 493 | 493 | private function findFileWithExtension($class, $ext) |
| 494 | 494 | { |
| 495 | 495 | // PSR-4 lookup |
| 496 | - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; |
|
| 496 | + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR).$ext; |
|
| 497 | 497 | |
| 498 | 498 | $first = $class[0]; |
| 499 | 499 | if (isset($this->prefixLengthsPsr4[$first])) { |
| 500 | 500 | $subPath = $class; |
| 501 | 501 | while (false !== $lastPos = strrpos($subPath, '\\')) { |
| 502 | 502 | $subPath = substr($subPath, 0, $lastPos); |
| 503 | - $search = $subPath . '\\'; |
|
| 503 | + $search = $subPath.'\\'; |
|
| 504 | 504 | if (isset($this->prefixDirsPsr4[$search])) { |
| 505 | - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); |
|
| 505 | + $pathEnd = DIRECTORY_SEPARATOR.substr($logicalPathPsr4, $lastPos+1); |
|
| 506 | 506 | foreach ($this->prefixDirsPsr4[$search] as $dir) { |
| 507 | - if (file_exists($file = $dir . $pathEnd)) { |
|
| 507 | + if (file_exists($file = $dir.$pathEnd)) { |
|
| 508 | 508 | return $file; |
| 509 | 509 | } |
| 510 | 510 | } |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | |
| 515 | 515 | // PSR-4 fallback dirs |
| 516 | 516 | foreach ($this->fallbackDirsPsr4 as $dir) { |
| 517 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { |
|
| 517 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr4)) { |
|
| 518 | 518 | return $file; |
| 519 | 519 | } |
| 520 | 520 | } |
@@ -522,18 +522,18 @@ discard block |
||
| 522 | 522 | // PSR-0 lookup |
| 523 | 523 | if (false !== $pos = strrpos($class, '\\')) { |
| 524 | 524 | // namespaced class name |
| 525 | - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) |
|
| 526 | - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); |
|
| 525 | + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos+1) |
|
| 526 | + . strtr(substr($logicalPathPsr4, $pos+1), '_', DIRECTORY_SEPARATOR); |
|
| 527 | 527 | } else { |
| 528 | 528 | // PEAR-like class name |
| 529 | - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; |
|
| 529 | + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR).$ext; |
|
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | if (isset($this->prefixesPsr0[$first])) { |
| 533 | 533 | foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { |
| 534 | 534 | if (0 === strpos($class, $prefix)) { |
| 535 | 535 | foreach ($dirs as $dir) { |
| 536 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
| 536 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
| 537 | 537 | return $file; |
| 538 | 538 | } |
| 539 | 539 | } |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | |
| 544 | 544 | // PSR-0 fallback dirs |
| 545 | 545 | foreach ($this->fallbackDirsPsr0 as $dir) { |
| 546 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
| 546 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
| 547 | 547 | return $file; |
| 548 | 548 | } |
| 549 | 549 | } |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | 'pretty_version' => 'dev-master', |
| 4 | 4 | 'version' => 'dev-master', |
| 5 | 5 | 'type' => 'plugin', |
| 6 | - 'install_path' => __DIR__ . '/../../', |
|
| 6 | + 'install_path' => __DIR__.'/../../', |
|
| 7 | 7 | 'aliases' => array(), |
| 8 | 8 | 'reference' => '38b433d62fd7ed4e56e24355a5d2ec67274233d9', |
| 9 | 9 | 'name' => 'mprins/dokuwiki-plugin-geophp', |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | 'pretty_version' => 'v2.0.0', |
| 15 | 15 | 'version' => '2.0.0.0', |
| 16 | 16 | 'type' => 'library', |
| 17 | - 'install_path' => __DIR__ . '/../funiq/geophp', |
|
| 17 | + 'install_path' => __DIR__.'/../funiq/geophp', |
|
| 18 | 18 | 'aliases' => array(), |
| 19 | 19 | 'reference' => '42ba83cda286f9b76cf6da2e149e2cb36cefc6e8', |
| 20 | 20 | 'dev_requirement' => false, |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | 'pretty_version' => 'dev-master', |
| 24 | 24 | 'version' => 'dev-master', |
| 25 | 25 | 'type' => 'plugin', |
| 26 | - 'install_path' => __DIR__ . '/../../', |
|
| 26 | + 'install_path' => __DIR__.'/../../', |
|
| 27 | 27 | 'aliases' => array(), |
| 28 | 28 | 'reference' => '38b433d62fd7ed4e56e24355a5d2ec67274233d9', |
| 29 | 29 | 'dev_requirement' => false, |