| Total Complexity | 4 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 4 | ||
| Bugs | 1 | Features | 3 |
| 1 | <?php |
||
| 21 | class Polygon extends GeoJSON implements GeoJSONTypeInterface, Multipliable |
||
| 22 | { |
||
| 23 | |||
| 24 | /** |
||
| 25 | * The GeoJSON schema type |
||
| 26 | * @var string |
||
| 27 | */ |
||
| 28 | protected $type = GeoJSON::TYPE_POLYGON; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * The LinearRing collection |
||
| 32 | * @var LinearRing |
||
| 33 | */ |
||
| 34 | private $polygon; |
||
| 35 | |||
| 36 | 8 | public function __construct(LinearRing $polygon) |
|
| 37 | { |
||
| 38 | 8 | $this->polygon = $polygon; |
|
| 39 | 8 | } |
|
| 40 | |||
| 41 | /** |
||
| 42 | * Exports the type specific schema element(s). |
||
| 43 | * @return array |
||
| 44 | */ |
||
| 45 | 2 | public function export() |
|
| 46 | { |
||
| 47 | return [ |
||
| 48 | 2 | 'coordinates' => $this->polygon->get(), |
|
| 49 | ]; |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Export the polygon data as an array. |
||
| 54 | * @return array |
||
| 55 | */ |
||
| 56 | 2 | public function exportArray() |
|
| 57 | { |
||
| 58 | 2 | return $this->polygon->get(); |
|
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * Validate the type specific schema element(s). |
||
| 63 | * @return boolean |
||
| 64 | */ |
||
| 65 | 2 | public function validate() |
|
| 68 | } |
||
| 69 | } |
||
| 70 |