Conditions | 5 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
30 | 2 | public function setData($data) |
|
31 | { |
||
32 | 2 | if ((! is_array($data) || ! isset($data['latitude']) || ! isset($data['longitude'])) && ! $this->allowNull()) |
|
33 | 2 | throw new InvalidParameterException('PointField data must be an array of fields with keys of latitude and longitude'); |
|
34 | |||
35 | // keeping it clean |
||
36 | // don't want other fields slipping in |
||
37 | 2 | $this->data = [ |
|
38 | 2 | 'latitude' => $data['latitude'], |
|
39 | 2 | 'longitude' => $data['longitude'] |
|
40 | 2 | ]; |
|
41 | 2 | return $this; |
|
42 | } |
||
43 | |||
52 |