From b7ce80d191f7e174fc5cb4d51a0da4621d270f54 Mon Sep 17 00:00:00 2001 From: Michel Tomas Date: Tue, 20 Jun 2023 18:41:52 +0200 Subject: [PATCH 1/2] #280: workaround wrong order of optional/nullable parameters --- src/Model/Struct.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model/Struct.php b/src/Model/Struct.php index 415fcc6f..f0271aab 100644 --- a/src/Model/Struct.php +++ b/src/Model/Struct.php @@ -410,8 +410,8 @@ protected function putRequiredAttributesFirst(StructAttributeContainer $allAttri } array_walk($requiredAttributes, [$attributes, 'add']); - array_walk($notRequiredAttributes, [$attributes, 'add']); array_walk($nullableNotRequiredAttributes, [$attributes, 'add']); + array_walk($notRequiredAttributes, [$attributes, 'add']); unset($requiredAttributes, $notRequiredAttributes, $nullableNotRequiredAttributes); From 1b4058b5296cdbc5016fad42e4abab41db0ee4c4 Mon Sep 17 00:00:00 2001 From: Michel Tomas Date: Fri, 4 Oct 2024 10:41:29 +0200 Subject: [PATCH 2/2] tests: regen files used for tests --- .gitignore | 1 + .../generated/ValidCampaignGetItem.php | 484 +++++++++--------- .../generated/ValidHouseProfileData.php | 90 ++-- 3 files changed, 288 insertions(+), 287 deletions(-) diff --git a/.gitignore b/.gitignore index 88e72fcd..39ffa60b 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ bin tests/resources/generated coverage .phpunit.result.cache +box.phar diff --git a/tests/resources/generated/ValidCampaignGetItem.php b/tests/resources/generated/ValidCampaignGetItem.php index 84e1dd64..dbafdbe6 100644 --- a/tests/resources/generated/ValidCampaignGetItem.php +++ b/tests/resources/generated/ValidCampaignGetItem.php @@ -15,6 +15,60 @@ #[\AllowDynamicProperties] class ApiCampaignGetItem extends ApiCampaignBase { + /** + * The SourceId + * Meta information extracted from the WSDL + * - maxOccurs: 1 + * - minOccurs: 0 + * - nillable: true + * @var int|null + */ + public ?int $SourceId = null; + /** + * The DailyBudget + * Meta information extracted from the WSDL + * - maxOccurs: 1 + * - minOccurs: 0 + * - nillable: true + * @var \StructType\ApiDailyBudget|null + */ + public ?\StructType\ApiDailyBudget $DailyBudget = null; + /** + * The EndDate + * Meta information extracted from the WSDL + * - maxOccurs: 1 + * - minOccurs: 0 + * - nillable: true + * @var string|null + */ + public ?string $EndDate = null; + /** + * The NegativeKeywords + * Meta information extracted from the WSDL + * - maxOccurs: 1 + * - minOccurs: 0 + * - nillable: true + * @var \ArrayType\ApiArrayOfString|null + */ + public ?\ArrayType\ApiArrayOfString $NegativeKeywords = null; + /** + * The BlockedIps + * Meta information extracted from the WSDL + * - maxOccurs: 1 + * - minOccurs: 0 + * - nillable: true + * @var \ArrayType\ApiArrayOfString|null + */ + public ?\ArrayType\ApiArrayOfString $BlockedIps = null; + /** + * The ExcludedSites + * Meta information extracted from the WSDL + * - maxOccurs: 1 + * - minOccurs: 0 + * - nillable: true + * @var \ArrayType\ApiArrayOfString|null + */ + public ?\ArrayType\ApiArrayOfString $ExcludedSites = null; /** * The Id * Meta information extracted from the WSDL @@ -135,62 +189,14 @@ class ApiCampaignGetItem extends ApiCampaignBase * @var \StructType\ApiDynamicTextCampaignGetItem|null */ public ?\StructType\ApiDynamicTextCampaignGetItem $DynamicTextCampaign = null; - /** - * The SourceId - * Meta information extracted from the WSDL - * - maxOccurs: 1 - * - minOccurs: 0 - * - nillable: true - * @var int|null - */ - public ?int $SourceId = null; - /** - * The DailyBudget - * Meta information extracted from the WSDL - * - maxOccurs: 1 - * - minOccurs: 0 - * - nillable: true - * @var \StructType\ApiDailyBudget|null - */ - public ?\StructType\ApiDailyBudget $DailyBudget = null; - /** - * The EndDate - * Meta information extracted from the WSDL - * - maxOccurs: 1 - * - minOccurs: 0 - * - nillable: true - * @var string|null - */ - public ?string $EndDate = null; - /** - * The NegativeKeywords - * Meta information extracted from the WSDL - * - maxOccurs: 1 - * - minOccurs: 0 - * - nillable: true - * @var \ArrayType\ApiArrayOfString|null - */ - public ?\ArrayType\ApiArrayOfString $NegativeKeywords = null; - /** - * The BlockedIps - * Meta information extracted from the WSDL - * - maxOccurs: 1 - * - minOccurs: 0 - * - nillable: true - * @var \ArrayType\ApiArrayOfString|null - */ - public ?\ArrayType\ApiArrayOfString $BlockedIps = null; - /** - * The ExcludedSites - * Meta information extracted from the WSDL - * - maxOccurs: 1 - * - minOccurs: 0 - * - nillable: true - * @var \ArrayType\ApiArrayOfString|null - */ - public ?\ArrayType\ApiArrayOfString $ExcludedSites = null; /** * Constructor method for CampaignGetItem + * @uses ApiCampaignGetItem::setSourceId() + * @uses ApiCampaignGetItem::setDailyBudget() + * @uses ApiCampaignGetItem::setEndDate() + * @uses ApiCampaignGetItem::setNegativeKeywords() + * @uses ApiCampaignGetItem::setBlockedIps() + * @uses ApiCampaignGetItem::setExcludedSites() * @uses ApiCampaignGetItem::setId() * @uses ApiCampaignGetItem::setName() * @uses ApiCampaignGetItem::setStartDate() @@ -206,12 +212,12 @@ class ApiCampaignGetItem extends ApiCampaignBase * @uses ApiCampaignGetItem::setTextCampaign() * @uses ApiCampaignGetItem::setMobileAppCampaign() * @uses ApiCampaignGetItem::setDynamicTextCampaign() - * @uses ApiCampaignGetItem::setSourceId() - * @uses ApiCampaignGetItem::setDailyBudget() - * @uses ApiCampaignGetItem::setEndDate() - * @uses ApiCampaignGetItem::setNegativeKeywords() - * @uses ApiCampaignGetItem::setBlockedIps() - * @uses ApiCampaignGetItem::setExcludedSites() + * @param int $sourceId + * @param \StructType\ApiDailyBudget $dailyBudget + * @param string $endDate + * @param \ArrayType\ApiArrayOfString $negativeKeywords + * @param \ArrayType\ApiArrayOfString $blockedIps + * @param \ArrayType\ApiArrayOfString $excludedSites * @param int $id * @param string $name * @param string $startDate @@ -227,16 +233,16 @@ class ApiCampaignGetItem extends ApiCampaignBase * @param \StructType\ApiTextCampaignGetItem $textCampaign * @param \StructType\ApiMobileAppCampaignGetItem $mobileAppCampaign * @param \StructType\ApiDynamicTextCampaignGetItem $dynamicTextCampaign - * @param int $sourceId - * @param \StructType\ApiDailyBudget $dailyBudget - * @param string $endDate - * @param \ArrayType\ApiArrayOfString $negativeKeywords - * @param \ArrayType\ApiArrayOfString $blockedIps - * @param \ArrayType\ApiArrayOfString $excludedSites */ - public function __construct(?int $id = null, ?string $name = null, ?string $startDate = null, ?string $type = null, ?string $status = null, ?string $state = null, ?string $statusPayment = null, ?string $statusClarification = null, ?\StructType\ApiStatistics $statistics = null, ?string $currency = null, ?\StructType\ApiFundsParam $funds = null, ?\StructType\ApiCampaignAssistant $representedBy = null, ?\StructType\ApiTextCampaignGetItem $textCampaign = null, ?\StructType\ApiMobileAppCampaignGetItem $mobileAppCampaign = null, ?\StructType\ApiDynamicTextCampaignGetItem $dynamicTextCampaign = null, ?int $sourceId = null, ?\StructType\ApiDailyBudget $dailyBudget = null, ?string $endDate = null, ?\ArrayType\ApiArrayOfString $negativeKeywords = null, ?\ArrayType\ApiArrayOfString $blockedIps = null, ?\ArrayType\ApiArrayOfString $excludedSites = null) + public function __construct(?int $sourceId = null, ?\StructType\ApiDailyBudget $dailyBudget = null, ?string $endDate = null, ?\ArrayType\ApiArrayOfString $negativeKeywords = null, ?\ArrayType\ApiArrayOfString $blockedIps = null, ?\ArrayType\ApiArrayOfString $excludedSites = null, ?int $id = null, ?string $name = null, ?string $startDate = null, ?string $type = null, ?string $status = null, ?string $state = null, ?string $statusPayment = null, ?string $statusClarification = null, ?\StructType\ApiStatistics $statistics = null, ?string $currency = null, ?\StructType\ApiFundsParam $funds = null, ?\StructType\ApiCampaignAssistant $representedBy = null, ?\StructType\ApiTextCampaignGetItem $textCampaign = null, ?\StructType\ApiMobileAppCampaignGetItem $mobileAppCampaign = null, ?\StructType\ApiDynamicTextCampaignGetItem $dynamicTextCampaign = null) { $this + ->setSourceId($sourceId) + ->setDailyBudget($dailyBudget) + ->setEndDate($endDate) + ->setNegativeKeywords($negativeKeywords) + ->setBlockedIps($blockedIps) + ->setExcludedSites($excludedSites) ->setId($id) ->setName($name) ->setStartDate($startDate) @@ -251,13 +257,175 @@ public function __construct(?int $id = null, ?string $name = null, ?string $star ->setRepresentedBy($representedBy) ->setTextCampaign($textCampaign) ->setMobileAppCampaign($mobileAppCampaign) - ->setDynamicTextCampaign($dynamicTextCampaign) - ->setSourceId($sourceId) - ->setDailyBudget($dailyBudget) - ->setEndDate($endDate) - ->setNegativeKeywords($negativeKeywords) - ->setBlockedIps($blockedIps) - ->setExcludedSites($excludedSites); + ->setDynamicTextCampaign($dynamicTextCampaign); + } + /** + * Get SourceId value + * An additional test has been added (isset) before returning the property value as + * this property may have been unset before, due to the fact that this property is + * removable from the request (nillable=true+minOccurs=0) + * @return int|null + */ + public function getSourceId(): ?int + { + return $this->SourceId ?? null; + } + /** + * Set SourceId value + * This property is removable from request (nillable=true+minOccurs=0), therefore + * if the value assigned to this property is null, it is removed from this object + * @param int $sourceId + * @return \StructType\ApiCampaignGetItem + */ + public function setSourceId(?int $sourceId = null): self + { + if (is_null($sourceId) || (is_array($sourceId) && empty($sourceId))) { + unset($this->SourceId); + } else { + $this->SourceId = $sourceId; + } + + return $this; + } + /** + * Get DailyBudget value + * An additional test has been added (isset) before returning the property value as + * this property may have been unset before, due to the fact that this property is + * removable from the request (nillable=true+minOccurs=0) + * @return \StructType\ApiDailyBudget|null + */ + public function getDailyBudget(): ?\StructType\ApiDailyBudget + { + return $this->DailyBudget ?? null; + } + /** + * Set DailyBudget value + * This property is removable from request (nillable=true+minOccurs=0), therefore + * if the value assigned to this property is null, it is removed from this object + * @param \StructType\ApiDailyBudget $dailyBudget + * @return \StructType\ApiCampaignGetItem + */ + public function setDailyBudget(?\StructType\ApiDailyBudget $dailyBudget = null): self + { + if (is_null($dailyBudget) || (is_array($dailyBudget) && empty($dailyBudget))) { + unset($this->DailyBudget); + } else { + $this->DailyBudget = $dailyBudget; + } + + return $this; + } + /** + * Get EndDate value + * An additional test has been added (isset) before returning the property value as + * this property may have been unset before, due to the fact that this property is + * removable from the request (nillable=true+minOccurs=0) + * @return string|null + */ + public function getEndDate(): ?string + { + return $this->EndDate ?? null; + } + /** + * Set EndDate value + * This property is removable from request (nillable=true+minOccurs=0), therefore + * if the value assigned to this property is null, it is removed from this object + * @param string $endDate + * @return \StructType\ApiCampaignGetItem + */ + public function setEndDate(?string $endDate = null): self + { + if (is_null($endDate) || (is_array($endDate) && empty($endDate))) { + unset($this->EndDate); + } else { + $this->EndDate = $endDate; + } + + return $this; + } + /** + * Get NegativeKeywords value + * An additional test has been added (isset) before returning the property value as + * this property may have been unset before, due to the fact that this property is + * removable from the request (nillable=true+minOccurs=0) + * @return \ArrayType\ApiArrayOfString|null + */ + public function getNegativeKeywords(): ?\ArrayType\ApiArrayOfString + { + return $this->NegativeKeywords ?? null; + } + /** + * Set NegativeKeywords value + * This property is removable from request (nillable=true+minOccurs=0), therefore + * if the value assigned to this property is null, it is removed from this object + * @param \ArrayType\ApiArrayOfString $negativeKeywords + * @return \StructType\ApiCampaignGetItem + */ + public function setNegativeKeywords(?\ArrayType\ApiArrayOfString $negativeKeywords = null): self + { + if (is_null($negativeKeywords) || (is_array($negativeKeywords) && empty($negativeKeywords))) { + unset($this->NegativeKeywords); + } else { + $this->NegativeKeywords = $negativeKeywords; + } + + return $this; + } + /** + * Get BlockedIps value + * An additional test has been added (isset) before returning the property value as + * this property may have been unset before, due to the fact that this property is + * removable from the request (nillable=true+minOccurs=0) + * @return \ArrayType\ApiArrayOfString|null + */ + public function getBlockedIps(): ?\ArrayType\ApiArrayOfString + { + return $this->BlockedIps ?? null; + } + /** + * Set BlockedIps value + * This property is removable from request (nillable=true+minOccurs=0), therefore + * if the value assigned to this property is null, it is removed from this object + * @param \ArrayType\ApiArrayOfString $blockedIps + * @return \StructType\ApiCampaignGetItem + */ + public function setBlockedIps(?\ArrayType\ApiArrayOfString $blockedIps = null): self + { + if (is_null($blockedIps) || (is_array($blockedIps) && empty($blockedIps))) { + unset($this->BlockedIps); + } else { + $this->BlockedIps = $blockedIps; + } + + return $this; + } + /** + * Get ExcludedSites value + * An additional test has been added (isset) before returning the property value as + * this property may have been unset before, due to the fact that this property is + * removable from the request (nillable=true+minOccurs=0) + * @return \ArrayType\ApiArrayOfString|null + */ + public function getExcludedSites(): ?\ArrayType\ApiArrayOfString + { + return $this->ExcludedSites ?? null; + } + /** + * Set ExcludedSites value + * This property is removable from request (nillable=true+minOccurs=0), therefore + * if the value assigned to this property is null, it is removed from this object + * @param \ArrayType\ApiArrayOfString $excludedSites + * @return \StructType\ApiCampaignGetItem + */ + public function setExcludedSites(?\ArrayType\ApiArrayOfString $excludedSites = null): self + { + if (is_null($excludedSites) || (is_array($excludedSites) && empty($excludedSites))) { + unset($this->ExcludedSites); + } else { + $this->ExcludedSites = $excludedSites; + } + + return $this; } /** * Get Id value @@ -542,174 +710,6 @@ public function setDynamicTextCampaign(?\StructType\ApiDynamicTextCampaignGetIte { $this->DynamicTextCampaign = $dynamicTextCampaign; - return $this; - } - /** - * Get SourceId value - * An additional test has been added (isset) before returning the property value as - * this property may have been unset before, due to the fact that this property is - * removable from the request (nillable=true+minOccurs=0) - * @return int|null - */ - public function getSourceId(): ?int - { - return $this->SourceId ?? null; - } - /** - * Set SourceId value - * This property is removable from request (nillable=true+minOccurs=0), therefore - * if the value assigned to this property is null, it is removed from this object - * @param int $sourceId - * @return \StructType\ApiCampaignGetItem - */ - public function setSourceId(?int $sourceId = null): self - { - if (is_null($sourceId) || (is_array($sourceId) && empty($sourceId))) { - unset($this->SourceId); - } else { - $this->SourceId = $sourceId; - } - - return $this; - } - /** - * Get DailyBudget value - * An additional test has been added (isset) before returning the property value as - * this property may have been unset before, due to the fact that this property is - * removable from the request (nillable=true+minOccurs=0) - * @return \StructType\ApiDailyBudget|null - */ - public function getDailyBudget(): ?\StructType\ApiDailyBudget - { - return $this->DailyBudget ?? null; - } - /** - * Set DailyBudget value - * This property is removable from request (nillable=true+minOccurs=0), therefore - * if the value assigned to this property is null, it is removed from this object - * @param \StructType\ApiDailyBudget $dailyBudget - * @return \StructType\ApiCampaignGetItem - */ - public function setDailyBudget(?\StructType\ApiDailyBudget $dailyBudget = null): self - { - if (is_null($dailyBudget) || (is_array($dailyBudget) && empty($dailyBudget))) { - unset($this->DailyBudget); - } else { - $this->DailyBudget = $dailyBudget; - } - - return $this; - } - /** - * Get EndDate value - * An additional test has been added (isset) before returning the property value as - * this property may have been unset before, due to the fact that this property is - * removable from the request (nillable=true+minOccurs=0) - * @return string|null - */ - public function getEndDate(): ?string - { - return $this->EndDate ?? null; - } - /** - * Set EndDate value - * This property is removable from request (nillable=true+minOccurs=0), therefore - * if the value assigned to this property is null, it is removed from this object - * @param string $endDate - * @return \StructType\ApiCampaignGetItem - */ - public function setEndDate(?string $endDate = null): self - { - if (is_null($endDate) || (is_array($endDate) && empty($endDate))) { - unset($this->EndDate); - } else { - $this->EndDate = $endDate; - } - - return $this; - } - /** - * Get NegativeKeywords value - * An additional test has been added (isset) before returning the property value as - * this property may have been unset before, due to the fact that this property is - * removable from the request (nillable=true+minOccurs=0) - * @return \ArrayType\ApiArrayOfString|null - */ - public function getNegativeKeywords(): ?\ArrayType\ApiArrayOfString - { - return $this->NegativeKeywords ?? null; - } - /** - * Set NegativeKeywords value - * This property is removable from request (nillable=true+minOccurs=0), therefore - * if the value assigned to this property is null, it is removed from this object - * @param \ArrayType\ApiArrayOfString $negativeKeywords - * @return \StructType\ApiCampaignGetItem - */ - public function setNegativeKeywords(?\ArrayType\ApiArrayOfString $negativeKeywords = null): self - { - if (is_null($negativeKeywords) || (is_array($negativeKeywords) && empty($negativeKeywords))) { - unset($this->NegativeKeywords); - } else { - $this->NegativeKeywords = $negativeKeywords; - } - - return $this; - } - /** - * Get BlockedIps value - * An additional test has been added (isset) before returning the property value as - * this property may have been unset before, due to the fact that this property is - * removable from the request (nillable=true+minOccurs=0) - * @return \ArrayType\ApiArrayOfString|null - */ - public function getBlockedIps(): ?\ArrayType\ApiArrayOfString - { - return $this->BlockedIps ?? null; - } - /** - * Set BlockedIps value - * This property is removable from request (nillable=true+minOccurs=0), therefore - * if the value assigned to this property is null, it is removed from this object - * @param \ArrayType\ApiArrayOfString $blockedIps - * @return \StructType\ApiCampaignGetItem - */ - public function setBlockedIps(?\ArrayType\ApiArrayOfString $blockedIps = null): self - { - if (is_null($blockedIps) || (is_array($blockedIps) && empty($blockedIps))) { - unset($this->BlockedIps); - } else { - $this->BlockedIps = $blockedIps; - } - - return $this; - } - /** - * Get ExcludedSites value - * An additional test has been added (isset) before returning the property value as - * this property may have been unset before, due to the fact that this property is - * removable from the request (nillable=true+minOccurs=0) - * @return \ArrayType\ApiArrayOfString|null - */ - public function getExcludedSites(): ?\ArrayType\ApiArrayOfString - { - return $this->ExcludedSites ?? null; - } - /** - * Set ExcludedSites value - * This property is removable from request (nillable=true+minOccurs=0), therefore - * if the value assigned to this property is null, it is removed from this object - * @param \ArrayType\ApiArrayOfString $excludedSites - * @return \StructType\ApiCampaignGetItem - */ - public function setExcludedSites(?\ArrayType\ApiArrayOfString $excludedSites = null): self - { - if (is_null($excludedSites) || (is_array($excludedSites) && empty($excludedSites))) { - unset($this->ExcludedSites); - } else { - $this->ExcludedSites = $excludedSites; - } - return $this; } } diff --git a/tests/resources/generated/ValidHouseProfileData.php b/tests/resources/generated/ValidHouseProfileData.php index edb0268e..f3da0160 100644 --- a/tests/resources/generated/ValidHouseProfileData.php +++ b/tests/resources/generated/ValidHouseProfileData.php @@ -16,15 +16,6 @@ #[\AllowDynamicProperties] class ApiHouseProfileData extends AbstractStructBase { - /** - * The area_total - * Meta information extracted from the WSDL - * - base: xsd:decimal - * - fractionDigits: 2 - * - totalDigits: 15 - * @var float|null - */ - protected ?float $area_total = null; /** * The area_residential * Meta information extracted from the WSDL @@ -431,9 +422,17 @@ class ApiHouseProfileData extends AbstractStructBase * @var \StructType\ApiFinance|null */ protected ?\StructType\ApiFinance $finance = null; + /** + * The area_total + * Meta information extracted from the WSDL + * - base: xsd:decimal + * - fractionDigits: 2 + * - totalDigits: 15 + * @var float|null + */ + protected ?float $area_total = null; /** * Constructor method for HouseProfileData - * @uses ApiHouseProfileData::setArea_total() * @uses ApiHouseProfileData::setArea_residential() * @uses ApiHouseProfileData::setArea_non_residential() * @uses ApiHouseProfileData::setCadastral_number() @@ -486,7 +485,7 @@ class ApiHouseProfileData extends AbstractStructBase * @uses ApiHouseProfileData::setCold_water_provider() * @uses ApiHouseProfileData::setDrainage_provider() * @uses ApiHouseProfileData::setFinance() - * @param float $area_total + * @uses ApiHouseProfileData::setArea_total() * @param float $area_residential * @param float $area_non_residential * @param string $cadastral_number @@ -539,11 +538,11 @@ class ApiHouseProfileData extends AbstractStructBase * @param \StructType\ApiProvider $cold_water_provider * @param \StructType\ApiProvider $drainage_provider * @param \StructType\ApiFinance $finance + * @param float $area_total */ - public function __construct(?float $area_total = null, ?float $area_residential = null, ?float $area_non_residential = null, ?string $cadastral_number = null, ?string $project_type = null, ?string $location_description = null, ?string $individual_name = null, ?string $house_type = null, ?string $exploitation_start_year = null, ?string $wall_material = null, ?string $floor_type = null, ?int $storeys_count = null, ?int $entrance_count = null, ?int $elevators_count = null, ?float $area_private = null, ?float $area_municipal = null, ?float $area_national = null, ?float $area_land = null, ?float $area_territory = null, ?string $inventory_number = null, ?int $flats_count = null, ?int $residents_count = null, ?int $accounts_count = null, ?string $construction_features = null, ?float $thermal_actual_expense = null, ?float $thermal_normative_expense = null, ?string $energy_efficiency = null, ?string $energy_audit_date = null, ?string $privatization_start_date = null, ?float $deterioration_total = null, ?float $deterioration_foundation = null, ?float $deterioration_bearing_walls = null, ?float $deterioration_floor = null, ?\StructType\ApiFacade $facade = null, ?\StructType\ApiRoof $roof = null, ?\StructType\ApiBasement $basement = null, ?\StructType\ApiCommonSpace $common_space = null, ?\StructType\ApiChute $chute = null, ?\StructType\ApiHeatingSystem $heating_system = null, ?\StructType\ApiHotWaterSystem $hot_water_system = null, ?\StructType\ApiColdWaterSystem $cold_water_system = null, ?\StructType\ApiSewerageSystem $sewerage_system = null, ?\StructType\ApiElectricitySystem $electricity_system = null, ?\StructType\ApiGasSystem $gas_system = null, ?array $lifts = null, ?\StructType\ApiManagementContract $management_contract = null, ?\StructType\ApiProvider $heating_provider = null, ?\StructType\ApiProvider $electricity_provider = null, ?\StructType\ApiProvider $gas_provider = null, ?\StructType\ApiProvider $hot_water_provider = null, ?\StructType\ApiProvider $cold_water_provider = null, ?\StructType\ApiProvider $drainage_provider = null, ?\StructType\ApiFinance $finance = null) + public function __construct(?float $area_residential = null, ?float $area_non_residential = null, ?string $cadastral_number = null, ?string $project_type = null, ?string $location_description = null, ?string $individual_name = null, ?string $house_type = null, ?string $exploitation_start_year = null, ?string $wall_material = null, ?string $floor_type = null, ?int $storeys_count = null, ?int $entrance_count = null, ?int $elevators_count = null, ?float $area_private = null, ?float $area_municipal = null, ?float $area_national = null, ?float $area_land = null, ?float $area_territory = null, ?string $inventory_number = null, ?int $flats_count = null, ?int $residents_count = null, ?int $accounts_count = null, ?string $construction_features = null, ?float $thermal_actual_expense = null, ?float $thermal_normative_expense = null, ?string $energy_efficiency = null, ?string $energy_audit_date = null, ?string $privatization_start_date = null, ?float $deterioration_total = null, ?float $deterioration_foundation = null, ?float $deterioration_bearing_walls = null, ?float $deterioration_floor = null, ?\StructType\ApiFacade $facade = null, ?\StructType\ApiRoof $roof = null, ?\StructType\ApiBasement $basement = null, ?\StructType\ApiCommonSpace $common_space = null, ?\StructType\ApiChute $chute = null, ?\StructType\ApiHeatingSystem $heating_system = null, ?\StructType\ApiHotWaterSystem $hot_water_system = null, ?\StructType\ApiColdWaterSystem $cold_water_system = null, ?\StructType\ApiSewerageSystem $sewerage_system = null, ?\StructType\ApiElectricitySystem $electricity_system = null, ?\StructType\ApiGasSystem $gas_system = null, ?array $lifts = null, ?\StructType\ApiManagementContract $management_contract = null, ?\StructType\ApiProvider $heating_provider = null, ?\StructType\ApiProvider $electricity_provider = null, ?\StructType\ApiProvider $gas_provider = null, ?\StructType\ApiProvider $hot_water_provider = null, ?\StructType\ApiProvider $cold_water_provider = null, ?\StructType\ApiProvider $drainage_provider = null, ?\StructType\ApiFinance $finance = null, ?float $area_total = null) { $this - ->setArea_total($area_total) ->setArea_residential($area_residential) ->setArea_non_residential($area_non_residential) ->setCadastral_number($cadastral_number) @@ -595,38 +594,8 @@ public function __construct(?float $area_total = null, ?float $area_residential ->setHot_water_provider($hot_water_provider) ->setCold_water_provider($cold_water_provider) ->setDrainage_provider($drainage_provider) - ->setFinance($finance); - } - /** - * Get area_total value - * @return float|null - */ - public function getArea_total(): ?float - { - return $this->area_total; - } - /** - * Set area_total value - * @param float $area_total - * @return \StructType\ApiHouseProfileData - */ - public function setArea_total(?float $area_total = null): self - { - // validation for constraint: float - if (!is_null($area_total) && !(is_float($area_total) || is_numeric($area_total))) { - throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($area_total, true), gettype($area_total)), __LINE__); - } - // validation for constraint: fractionDigits(2) - if (!is_null($area_total) && mb_strlen(mb_substr((string) $area_total, false !== mb_strpos((string) $area_total, '.') ? mb_strpos((string) $area_total, '.') + 1 : mb_strlen((string) $area_total))) > 2) { - throw new InvalidArgumentException(sprintf('Invalid value %s, the value must at most contain 2 fraction digits, %d given', var_export($area_total, true), mb_strlen(mb_substr((string) $area_total, mb_strpos((string) $area_total, '.') + 1))), __LINE__); - } - // validation for constraint: totalDigits(15) - if (!is_null($area_total) && mb_strlen(preg_replace('/(\D)/', '', (string) $area_total)) > 15) { - throw new InvalidArgumentException(sprintf('Invalid value %s, the value must use at most 15 digits, "%d" given', var_export($area_total, true), mb_strlen(preg_replace('/(\D)/', '', (string) $area_total))), __LINE__); - } - $this->area_total = $area_total; - - return $this; + ->setFinance($finance) + ->setArea_total($area_total); } /** * Get area_residential value @@ -1906,6 +1875,37 @@ public function setFinance(?\StructType\ApiFinance $finance = null): self { $this->finance = $finance; + return $this; + } + /** + * Get area_total value + * @return float|null + */ + public function getArea_total(): ?float + { + return $this->area_total; + } + /** + * Set area_total value + * @param float $area_total + * @return \StructType\ApiHouseProfileData + */ + public function setArea_total(?float $area_total = null): self + { + // validation for constraint: float + if (!is_null($area_total) && !(is_float($area_total) || is_numeric($area_total))) { + throw new InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($area_total, true), gettype($area_total)), __LINE__); + } + // validation for constraint: fractionDigits(2) + if (!is_null($area_total) && mb_strlen(mb_substr((string) $area_total, false !== mb_strpos((string) $area_total, '.') ? mb_strpos((string) $area_total, '.') + 1 : mb_strlen((string) $area_total))) > 2) { + throw new InvalidArgumentException(sprintf('Invalid value %s, the value must at most contain 2 fraction digits, %d given', var_export($area_total, true), mb_strlen(mb_substr((string) $area_total, mb_strpos((string) $area_total, '.') + 1))), __LINE__); + } + // validation for constraint: totalDigits(15) + if (!is_null($area_total) && mb_strlen(preg_replace('/(\D)/', '', (string) $area_total)) > 15) { + throw new InvalidArgumentException(sprintf('Invalid value %s, the value must use at most 15 digits, "%d" given', var_export($area_total, true), mb_strlen(preg_replace('/(\D)/', '', (string) $area_total))), __LINE__); + } + $this->area_total = $area_total; + return $this; } }