Skip to content

Commit 6aebc99

Browse files
authored
Update cast/param types (#195)
* Update cast/param types
1 parent 1717c99 commit 6aebc99

7 files changed

Lines changed: 34 additions & 34 deletions

File tree

src/Batch/BatchGeocoded.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function getCoordinates()
147147
/**
148148
* Returns the latitude value.
149149
*
150-
* @return double
150+
* @return float
151151
*/
152152
public function getLatitude()
153153
{
@@ -161,7 +161,7 @@ public function getLatitude()
161161
/**
162162
* Returns the longitude value.
163163
*
164-
* @return double
164+
* @return float
165165
*/
166166
public function getLongitude()
167167
{

src/Coordinate/Coordinate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ class Coordinate implements CoordinateInterface, \JsonSerializable
2424
/**
2525
* The latitude of the coordinate.
2626
*
27-
* @var double
27+
* @var float
2828
*/
2929
protected $latitude;
3030

3131
/**
3232
* The longitude of the coordinate.
3333
*
34-
* @var double
34+
* @var float
3535
*/
3636
protected $longitude;
3737

src/Coordinate/CoordinateInterface.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ interface CoordinateInterface
2222
* Normalizes a latitude to the (-90, 90) range.
2323
* Latitudes below -90.0 or above 90.0 degrees are capped, not wrapped.
2424
*
25-
* @param double $latitude The latitude to normalize
25+
* @param float $latitude The latitude to normalize
2626
*
2727
* @return string
2828
*/
@@ -32,7 +32,7 @@ public function normalizeLatitude($latitude);
3232
* Normalizes a longitude to the (-180, 180) range.
3333
* Longitudes below -180.0 or abode 180.0 degrees are wrapped.
3434
*
35-
* @param double $longitude The longitude to normalize
35+
* @param float $longitude The longitude to normalize
3636
*
3737
* @return string
3838
*/
@@ -41,7 +41,7 @@ public function normalizeLongitude($longitude);
4141
/**
4242
* Set the latitude.
4343
*
44-
* @param double $latitude
44+
* @param float $latitude
4545
*/
4646
public function setLatitude($latitude);
4747

@@ -55,7 +55,7 @@ public function getLatitude();
5555
/**
5656
* Set the longitude.
5757
*
58-
* @param double $longitude
58+
* @param float $longitude
5959
*/
6060
public function setLongitude($longitude);
6161

src/Coordinate/Ellipsoid.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ class Ellipsoid
6565
* @see http://en.wikipedia.org/wiki/Earth_radius
6666
* @see http://home.online.no/~sigurdhu/WGS84_Eng.html
6767
*
68-
* @var double
68+
* @var float
6969
*/
7070
protected $a;
7171

7272
/**
7373
* The inverse flattening.
7474
* @see http://home.online.no/~sigurdhu/WGS84_Eng.html
7575
*
76-
* @var double
76+
* @var float
7777
*/
7878
protected $invF;
7979

@@ -209,14 +209,14 @@ class Ellipsoid
209209
* Create a new ellipsoid.
210210
*
211211
* @param string $name The name of the ellipsoid to create.
212-
* @param double $a The semi-major axis (equatorial radius) in meters.
213-
* @param double $invF The inverse flattening.
212+
* @param float $a The semi-major axis (equatorial radius) in meters.
213+
* @param float $invF The inverse flattening.
214214
*
215215
* @throws InvalidArgumentException
216216
*/
217217
public function __construct($name, $a, $invF)
218218
{
219-
if (0.0 >= (double) $invF) {
219+
if (0.0 >= (float) $invF) {
220220
throw new InvalidArgumentException('The inverse flattening cannot be negative or equal to zero !');
221221
}
222222

@@ -294,43 +294,43 @@ public function getName()
294294
/**
295295
* Returns the semi-major axis (equatorial radius) in meters.
296296
*
297-
* @return double
297+
* @return float
298298
*/
299299
public function getA()
300300
{
301-
return (double) $this->a;
301+
return (float) $this->a;
302302
}
303303

304304
/**
305305
* Computes and returns the semi-minor axis (polar distance) in meters.
306306
* @see http://home.online.no/~sigurdhu/WGS84_Eng.html
307307
*
308-
* @return double
308+
* @return float
309309
*/
310310
public function getB()
311311
{
312-
return (double) $this->a * (1 - 1 / $this->invF);
312+
return (float) $this->a * (1 - 1 / $this->invF);
313313
}
314314

315315
/**
316316
* Returns the inverse flattening.
317317
*
318-
* @return double
318+
* @return float
319319
*/
320320
public function getInvF()
321321
{
322-
return (double) $this->invF;
322+
return (float) $this->invF;
323323
}
324324

325325
/**
326326
* Computes and returns the arithmetic mean radius in meters.
327327
* @see http://home.online.no/~sigurdhu/WGS84_Eng.html
328328
*
329-
* @return double
329+
* @return float
330330
*/
331331
public function getArithmeticMeanRadius()
332332
{
333-
return (double) $this->a * (1 - 1 / $this->invF / 3);
333+
return (float) $this->a * (1 - 1 / $this->invF / 3);
334334
}
335335

336336
/**

src/Distance/Distance.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function in($unit)
8686
* @see http://en.wikipedia.org/wiki/Pythagorean_theorem
8787
* @see http://en.wikipedia.org/wiki/Equirectangular_projection
8888
*
89-
* @return double The distance in meters
89+
* @return float The distance in meters
9090
*/
9191
public function flat()
9292
{
@@ -111,7 +111,7 @@ public function flat()
111111
* @see http://www.ga.gov.au/earth-monitoring/geodesy/geodetic-techniques/distance-calculation-algorithms.html#circle
112112
* @see http://en.wikipedia.org/wiki/Cosine_law
113113
*
114-
* @return double The distance in meters
114+
* @return float The distance in meters
115115
*/
116116
public function greatCircle()
117117
{
@@ -136,7 +136,7 @@ public function greatCircle()
136136
* two coordinates using the Haversine formula which is accurate to around 0.3%.
137137
* @see http://www.movable-type.co.uk/scripts/latlong.html
138138
*
139-
* @return double The distance in meters
139+
* @return float The distance in meters
140140
*/
141141
public function haversine()
142142
{
@@ -161,7 +161,7 @@ public function haversine()
161161
* formula for ellipsoids which is accurate to within 0.5mm.
162162
* @see http://www.movable-type.co.uk/scripts/latlong-vincenty.html
163163
*
164-
* @return double The distance in meters
164+
* @return float The distance in meters
165165
*/
166166
public function vincenty()
167167
{
@@ -229,9 +229,9 @@ public function vincenty()
229229
* Converts results in meters to user's unit (if any).
230230
* The default returned value is in meters.
231231
*
232-
* @param double $meters
232+
* @param float $meters
233233
*
234-
* @return double
234+
* @return float
235235
*/
236236
protected function convertToUserUnit($meters)
237237
{

src/GeotoolsInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@ interface GeotoolsInterface
3030
* Transverse Mercator is not the same as UTM.
3131
* A scale factor is required to convert between them.
3232
*
33-
* @var double
33+
* @var float
3434
*/
3535
const UTM_SCALE_FACTOR = 0.9996;
3636

3737
/**
3838
* The ratio meters per mile.
3939
*
40-
* @var double
40+
* @var float
4141
*/
4242
const METERS_PER_MILE = 1609.344;
4343

4444
/**
4545
* The ratio feet per meter.
4646
*
47-
* @var double
47+
* @var float
4848
*/
4949
const FEET_PER_METER = 0.3048;
5050

src/Vertex/Vertex.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ class Vertex implements VertexInterface
2727
use CoordinateCouple;
2828

2929
/**
30-
* @var double
30+
* @var float
3131
*/
3232
protected $gradient;
3333

3434
/**
35-
* @var double
35+
* @var float
3636
*/
3737
protected $ordinateIntercept;
3838

@@ -187,7 +187,7 @@ public function initialCardinal()
187187
{
188188
Ellipsoid::checkCoordinatesEllipsoid($this->from, $this->to);
189189

190-
return Geotools::$cardinalPoints[(integer) round($this->initialBearing() / 22.5)];
190+
return Geotools::$cardinalPoints[(int) round($this->initialBearing() / 22.5)];
191191
}
192192

193193
/**
@@ -201,7 +201,7 @@ public function finalCardinal()
201201
{
202202
Ellipsoid::checkCoordinatesEllipsoid($this->from, $this->to);
203203

204-
return Geotools::$cardinalPoints[(integer) round($this->finalBearing() / 22.5)];
204+
return Geotools::$cardinalPoints[(int) round($this->finalBearing() / 22.5)];
205205
}
206206

207207
/**

0 commit comments

Comments
 (0)