| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 12 | public function __construct($value) |
|
| 19 | { |
||
| 20 | 12 | $filteredValue = \filter_var($value, FILTER_VALIDATE_FLOAT); |
|
| 21 | |||
| 22 | 12 | if (false === $filteredValue) { |
|
| 23 | 1 | throw new InvalidNativeArgumentException($value, array('float')); |
|
| 24 | } |
||
| 25 | |||
| 26 | // normalization process through Coordinate object |
||
| 27 | 11 | $coordinate = new BaseCoordinate(array($filteredValue, 0)); |
|
| 28 | 11 | $latitude = $coordinate->getLatitude(); |
|
| 29 | |||
| 30 | 11 | $this->value = $latitude; |
|
| 31 | 11 | } |
|
| 32 | } |
||
| 33 |