Total Complexity | 3 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
20 | class Feature extends GeoJSON implements GeoJSONTypeInterface |
||
21 | { |
||
22 | |||
23 | /** |
||
24 | * The GeoJSON schema type |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $type = GeoJSON::TYPE_FEATURE; |
||
28 | |||
29 | /** |
||
30 | * The Geometry Object |
||
31 | * @var Multipliable |
||
32 | */ |
||
33 | private $geometry; |
||
34 | |||
35 | /** |
||
36 | * Feature properties array. |
||
37 | * @param array $geometry |
||
38 | */ |
||
39 | private $properties; |
||
40 | |||
41 | 8 | public function __construct(Multipliable $geometry, array $properties = []) |
|
45 | 8 | } |
|
46 | |||
47 | /** |
||
48 | * Exports the type specific schema element(s). |
||
49 | * @return array |
||
50 | */ |
||
51 | 6 | public function export() |
|
52 | { |
||
53 | return [ |
||
54 | 6 | 'geometry' => $this->geometry->generateMember(), |
|
|
|||
55 | 6 | 'properties' => $this->properties, |
|
56 | ]; |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * Validate the type specific schema element(s). |
||
61 | * @return boolean |
||
62 | */ |
||
63 | 2 | public function validate() |
|
67 | } |
||
68 | } |
||
69 |