@@ -55,7 +55,7 @@ |
||
| 55 | 55 | $queryParams = array_intersect_ukey( |
| 56 | 56 | $request->requestVars(), |
| 57 | 57 | $config['searchable_fields'], |
| 58 | - function ($a, $b) { |
|
| 58 | + function($a, $b) { |
|
| 59 | 59 | $a = explode(':', $a)[0]; |
| 60 | 60 | $b = explode(':', $b)[0]; |
| 61 | 61 | return strcmp($a, $b); |
@@ -40,7 +40,9 @@ discard block |
||
| 40 | 40 | // The HTTP kernel keeps a copy of the response body, which |
| 41 | 41 | // can exhaust the memory limit for large data sets. So we |
| 42 | 42 | // opt out and flush the buffer after processing each feature. |
| 43 | - if (!($is_test = headers_sent())) header('Content-Type: application/geo+json'); |
|
| 43 | + if (!($is_test = headers_sent())) { |
|
| 44 | + header('Content-Type: application/geo+json'); |
|
| 45 | + } |
|
| 44 | 46 | echo '{"type":"FeatureCollection","features":['; |
| 45 | 47 | |
| 46 | 48 | foreach ($list as $item) { |
@@ -70,6 +72,8 @@ discard block |
||
| 70 | 72 | } |
| 71 | 73 | |
| 72 | 74 | echo ']}'; |
| 73 | - if (!$is_test) die; |
|
| 75 | + if (!$is_test) { |
|
| 76 | + die; |
|
| 77 | + } |
|
| 74 | 78 | } |
| 75 | 79 | } |
@@ -53,7 +53,6 @@ |
||
| 53 | 53 | $where = DB::get_schema()->translateStGeometryTypeFilter($field, $value, $inclusive); |
| 54 | 54 | |
| 55 | 55 | return $this->aggregate ? |
| 56 | - $this->applyAggregate($query, $where) : |
|
| 57 | - $query->where($where); |
|
| 56 | + $this->applyAggregate($query, $where) : $query->where($where); |
|
| 58 | 57 | } |
| 59 | 58 | } |
@@ -57,7 +57,6 @@ |
||
| 57 | 57 | $where = DB::get_schema()->translateStDistanceFilter($field, $value, $inclusive); |
| 58 | 58 | |
| 59 | 59 | return $this->aggregate ? |
| 60 | - $this->applyAggregate($query, $where) : |
|
| 61 | - $query->where($where); |
|
| 60 | + $this->applyAggregate($query, $where) : $query->where($where); |
|
| 62 | 61 | } |
| 63 | 62 | } |
@@ -57,7 +57,6 @@ |
||
| 57 | 57 | $where = DB::get_schema()->$translationMethod($field, $value, $inclusive, $stMethodHint); |
| 58 | 58 | |
| 59 | 59 | return $this->aggregate ? |
| 60 | - $this->applyAggregate($query, $where) : |
|
| 61 | - $query->where($where); |
|
| 60 | + $this->applyAggregate($query, $where) : $query->where($where); |
|
| 62 | 61 | } |
| 63 | 62 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $coords = implode( |
| 63 | 63 | ',', |
| 64 | 64 | array_map( |
| 65 | - function ($coord) { |
|
| 65 | + function($coord) { |
|
| 66 | 66 | return implode( |
| 67 | 67 | ' ', |
| 68 | 68 | $coord |
@@ -82,11 +82,11 @@ discard block |
||
| 82 | 82 | $coords = '(' . implode( |
| 83 | 83 | '),(', |
| 84 | 84 | array_map( |
| 85 | - function ($coords) { |
|
| 85 | + function($coords) { |
|
| 86 | 86 | return implode( |
| 87 | 87 | ',', |
| 88 | 88 | array_map( |
| 89 | - function ($coord) { |
|
| 89 | + function($coord) { |
|
| 90 | 90 | return implode( |
| 91 | 91 | ' ', |
| 92 | 92 | $coord |
@@ -105,15 +105,15 @@ discard block |
||
| 105 | 105 | $coords = '(' . implode( |
| 106 | 106 | '),(', |
| 107 | 107 | array_map( |
| 108 | - function ($coords) { |
|
| 108 | + function($coords) { |
|
| 109 | 109 | return '(' . implode( |
| 110 | 110 | '),(', |
| 111 | 111 | array_map( |
| 112 | - function ($coords) { |
|
| 112 | + function($coords) { |
|
| 113 | 113 | return implode( |
| 114 | 114 | ',', |
| 115 | 115 | array_map( |
| 116 | - function ($coord) { |
|
| 116 | + function($coord) { |
|
| 117 | 117 | return implode(' ', $coord); |
| 118 | 118 | }, |
| 119 | 119 | $coords |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | $wkt = $ewkt; |
| 160 | 160 | $srid = (int)$fallbackSrid; |
| 161 | 161 | } |
| 162 | - return [$wkt,$srid]; |
|
| 162 | + return [$wkt, $srid]; |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | public static function get_type($geometry, $useBestGuess = false) |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | |
| 231 | 231 | protected static function reproject($coordinates, $fromProj, $toProj) |
| 232 | 232 | { |
| 233 | - return self::each($coordinates, function ($coordinate) use ($fromProj, $toProj) { |
|
| 233 | + return self::each($coordinates, function($coordinate) use ($fromProj, $toProj) { |
|
| 234 | 234 | return array_slice(self::$proj4->transform($toProj, new Point($coordinate[0], $coordinate[1], $fromProj))->toArray(), 0, 2); |
| 235 | 235 | }); |
| 236 | 236 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | $this->topLeft = [ |
| 74 | 74 | (($lon + 180) / 360) * $this->size * pow(2, $this->z), |
| 75 | - (0.5 - log((1 + sin($lat * pi()/180)) / (1 - sin($lat * pi()/180))) / (4 * pi())) * $this->size * pow(2, $this->z), |
|
| 75 | + (0.5 - log((1 + sin($lat * pi() / 180)) / (1 - sin($lat * pi() / 180))) / (4 * pi())) * $this->size * pow(2, $this->z), |
|
| 76 | 76 | ]; |
| 77 | 77 | |
| 78 | 78 | $this->resource = Injector::inst()->get('TileRenderer', false, [$this->size, $this->size, $defaultStyle]); |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $min = $max = null; |
| 112 | 112 | GIS::each( |
| 113 | 113 | $array, |
| 114 | - function ($lonlat) use (&$min, &$max) { |
|
| 114 | + function($lonlat) use (&$min, &$max) { |
|
| 115 | 115 | $min = is_null($min) ? $lonlat[0] : min($min, $lonlat[0]); |
| 116 | 116 | $max = is_null($max) ? $lonlat[0] : max($max, $lonlat[0]); |
| 117 | 117 | } |
@@ -125,10 +125,10 @@ discard block |
||
| 125 | 125 | foreach ($distance as $offset => &$dist) { |
| 126 | 126 | $dist = GIS::each( |
| 127 | 127 | $array, |
| 128 | - function ($lonlat) use ($offset) { |
|
| 128 | + function($lonlat) use ($offset) { |
|
| 129 | 129 | return [ |
| 130 | 130 | (($lonlat[0] + 180 - $offset) / 360) * $this->size * pow(2, $this->z) - $this->topLeft[0], |
| 131 | - (0.5 - log((1 + sin($lonlat[1] * pi()/180)) / (1 - sin($lonlat[1] * pi()/180))) / (4 * pi())) * $this->size * pow(2, $this->z) - $this->topLeft[1], |
|
| 131 | + (0.5 - log((1 + sin($lonlat[1] * pi() / 180)) / (1 - sin($lonlat[1] * pi() / 180))) / (4 * pi())) * $this->size * pow(2, $this->z) - $this->topLeft[1], |
|
| 132 | 132 | ]; |
| 133 | 133 | } |
| 134 | 134 | ); |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | $draw->setStrokeOpacity(1); |
| 65 | 65 | $draw->setStrokeColor(new ImagickPixel('rgb(92,92,255)')); |
| 66 | 66 | $draw->setFillColor(new ImagickPixel('rgba(92,92,255,0)')); |
| 67 | - $draw->setStrokeDashArray([5,5]); |
|
| 67 | + $draw->setStrokeDashArray([5, 5]); |
|
| 68 | 68 | $draw->setStrokeWidth(1); |
| 69 | 69 | |
| 70 | 70 | $draw->polyline([ |