diff --git a/src/Dto/ListingDto.php b/src/Dto/ListingDto.php index ba71d71..e552ed8 100644 --- a/src/Dto/ListingDto.php +++ b/src/Dto/ListingDto.php @@ -32,7 +32,7 @@ class ListingDto * Currently DRAFT listings are not fully supported so only create listings * in an OPEN state. * - * @var ListingState + * @var ListingStateEnum */ public $state = ListingStateEnum::OPEN; @@ -54,7 +54,7 @@ class ListingDto * The price type. Set it to NONE until the user has a chance to go to * CloudForest to enter their preferred pricing. * - * @var PriceType + * @var PriceTypeEnum */ public $priceType = PriceTypeEnum::NONE; @@ -62,7 +62,7 @@ class ListingDto * When the listing is available. Set it to NOW until the user has a chance * to go to CloudForest to enter their preferred availability. * - * @var ListingWhen + * @var ListingWhenEnum */ public $when = ListingWhenEnum::NOW; diff --git a/src/Schema/CompartmentSchema.php b/src/Schema/CompartmentSchema.php index 7b4077a..fd5e357 100644 --- a/src/Schema/CompartmentSchema.php +++ b/src/Schema/CompartmentSchema.php @@ -28,7 +28,7 @@ class CompartmentSchema * The type of the compartment. This allows the logic unit 'compartment' to * also represent other physical units like parcels and zones, if necessary. * - * @var CompartmentType + * @var CompartmentTypeEnum */ public $type = CompartmentTypeEnum::COMPARTMENT; @@ -45,7 +45,7 @@ class CompartmentSchema * * @var string */ - public $number = '1'; + public $number; /** * Any notes about the compartment, or null if none. @@ -77,10 +77,16 @@ class CompartmentSchema /** * Constructor. Supply the required properties (those without defaults). + * @param string $number * @return void */ - public function __construct() + public function __construct(string $number) { + if (mb_strlen($number) < 1) { + throw new \Exception('Compartment number cannot be less than 1 characters'); + } + + $this->number = $number; $this->boundary = new GeojsonSchema(GeojsonGeometryTypeEnum::POLYGON); $this->centroid = new GeojsonSchema(GeojsonGeometryTypeEnum::POINT); } diff --git a/src/Schema/GeojsonGeometrySchema.php b/src/Schema/GeojsonGeometrySchema.php index fbfed34..06d6e0b 100644 --- a/src/Schema/GeojsonGeometrySchema.php +++ b/src/Schema/GeojsonGeometrySchema.php @@ -16,7 +16,7 @@ class GeojsonGeometrySchema /** * The geometry type. We only send Points and Polygons to CloudForest. * - * @var GeojsonGeometryType + * @var GeojsonGeometryTypeEnum */ public $type; @@ -29,7 +29,7 @@ class GeojsonGeometrySchema /** * Constructor. Supply the required properties (those without defaults). - * @param GeojsonGeometryType $type + * @param GeojsonGeometryTypeEnum $type * @return void */ public function __construct(GeojsonGeometryTypeEnum $type) diff --git a/src/Schema/GeojsonSchema.php b/src/Schema/GeojsonSchema.php index c6673ed..d678f75 100644 --- a/src/Schema/GeojsonSchema.php +++ b/src/Schema/GeojsonSchema.php @@ -20,7 +20,7 @@ class GeojsonSchema * The Geojson type. We only send Features types to CloudForest, not * FeatureCollection types, so this is hardcoded to 'Feature'. * - * @var GeojsonType + * @var GeojsonTypeEnum */ public $type = GeojsonTypeEnum::FEATURE;