Update geo coordinates to use readonly properties rather than getters
This commit is contained in:
@@ -5,22 +5,12 @@ declare(strict_types=1);
|
|||||||
namespace Pcm\GeocodeBundle\Model;
|
namespace Pcm\GeocodeBundle\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A model for accessing latitude and longitude values
|
* A model for accessing latitude and longitude values.
|
||||||
*
|
*
|
||||||
* @package Pcm\GeocodeBundle
|
* @package Pcm\GeocodeBundle
|
||||||
*/
|
*/
|
||||||
final class GeoCoordinates
|
final class GeoCoordinates
|
||||||
{
|
{
|
||||||
public function __construct(private float $latitude, private float $longitude) {}
|
public function __construct(readonly public float $latitude, readonly public float $longitude) {}
|
||||||
|
|
||||||
public function getLatitude(): float
|
|
||||||
{
|
|
||||||
return $this->latitude;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getLongitude(): float
|
|
||||||
{
|
|
||||||
return $this->longitude;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user