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