Skip to content

Commit

Permalink
Merge tag '5.0.1' into develop
Browse files Browse the repository at this point in the history
 5.0.1
  • Loading branch information
Naugrimm committed Jun 4, 2024
2 parents 8513baa + b00cf0e commit f3de519
Show file tree
Hide file tree
Showing 17 changed files with 71 additions and 54 deletions.
8 changes: 4 additions & 4 deletions src/Nodes/DeliveryTimes.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

/**
* @implements NodeInterface<self>
* @method self setTerritories(string $territories)
* @method string getTerritories()
* @method self setTimeSpans(\Naugrim\BMEcat\Nodes\TimeSpan[]|array $timeSpans)
* @method \Naugrim\BMEcat\Nodes\TimeSpan[]|array getTimeSpans()
* @method self setTerritories(array $territories)
* @method string[] getTerritories()
* @method self setTimeSpans(\Naugrim\BMEcat\Nodes\TimeSpan|array $timeSpans)
* @method Naugrim\BMEcat\Nodes\TimeSpan[] getTimeSpans()
* @method self setLeadTime(float|null $leadTime)
* @method float|null getLeadTime()
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Nodes/Emails.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
* @implements NodeInterface<self>
* @method self setEmail(string $email)
* @method string getEmail()
* @method self setPublicKeys(\Naugrim\BMEcat\Nodes\Crypto\PublicKey[]|array $publicKeys)
* @method \Naugrim\BMEcat\Nodes\Crypto\PublicKey[]|array getPublicKeys()
* @method self setPublicKeys(\Naugrim\BMEcat\Nodes\Crypto\PublicKey|array $publicKeys)
* @method Naugrim\BMEcat\Nodes\Crypto\PublicKey[] getPublicKeys()
*/
class Emails implements NodeInterface
{
Expand Down
4 changes: 2 additions & 2 deletions src/Nodes/Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* @method \Naugrim\BMEcat\Nodes\BuyerIdRef|null getBuyerIdRef()
* @method self setSupplierIdRef(null|array|\Naugrim\BMEcat\Nodes\SupplierIdRef $supplierIdRef)
* @method \Naugrim\BMEcat\Nodes\SupplierIdRef|null getSupplierIdRef()
* @method self setParties(\Naugrim\BMEcat\Nodes\Party[]|array $parties)
* @method \Naugrim\BMEcat\Nodes\Party[]|array getParties()
* @method self setParties(\Naugrim\BMEcat\Nodes\Party|array $parties)
* @method Naugrim\BMEcat\Nodes\Party[] getParties()
*/
#[Serializer\XmlRoot('HEADER')]
class Header implements Contracts\NodeInterface
Expand Down
4 changes: 2 additions & 2 deletions src/Nodes/NewCatalog.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

/**
* @implements NodeInterface<self>
* @method self setProducts(\Naugrim\BMEcat\Nodes\Product[]|array $products)
* @method \Naugrim\BMEcat\Nodes\Product[]|array getProducts()
* @method self setProducts(\Naugrim\BMEcat\Nodes\Product|array $products)
* @method Naugrim\BMEcat\Nodes\Product[] getProducts()
*/
#[Serializer\XmlRoot('T_NEW_CATALOG')]
class NewCatalog implements Contracts\NodeInterface
Expand Down
8 changes: 4 additions & 4 deletions src/Nodes/Party.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
* @implements NodeInterface<self>
* @method self setId(string $id)
* @method string getId()
* @method self setRole(string $role)
* @method string getRole()
* @method self setRole(array $role)
* @method string[] getRole()
* @method self setAddress(\Naugrim\BMEcat\Nodes\Address[]|array $address)
* @method \Naugrim\BMEcat\Nodes\Address[]|array getAddress()
* @method self setMimes(\Naugrim\BMEcat\Nodes\Mime[]|array $mimes)
* @method \Naugrim\BMEcat\Nodes\Mime[]|array getMimes()
* @method self setMimes(\Naugrim\BMEcat\Nodes\Mime|array $mimes)
* @method Naugrim\BMEcat\Nodes\Mime[] getMimes()
*/
class Party implements NodeInterface
{
Expand Down
12 changes: 6 additions & 6 deletions src/Nodes/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
* @method \Naugrim\BMEcat\Nodes\SupplierPid|null getId()
* @method self setDetails(array|\Naugrim\BMEcat\Nodes\Product\Details $details)
* @method \Naugrim\BMEcat\Nodes\Product\Details getDetails()
* @method self setFeatures(\Naugrim\BMEcat\Nodes\Product\Features[]|array $features)
* @method \Naugrim\BMEcat\Nodes\Product\Features[]|array getFeatures()
* @method self setFeatures(\Naugrim\BMEcat\Nodes\Product\Features|array $features)
* @method Naugrim\BMEcat\Nodes\Product\Features[] getFeatures()
* @method self setOrderDetails(array|\Naugrim\BMEcat\Nodes\Product\OrderDetails $orderDetails)
* @method \Naugrim\BMEcat\Nodes\Product\OrderDetails getOrderDetails()
* @method self setPriceDetails(\Naugrim\BMEcat\Nodes\Product\PriceDetails[]|array $priceDetails)
* @method \Naugrim\BMEcat\Nodes\Product\PriceDetails[]|array getPriceDetails()
* @method self setMimes(\Naugrim\BMEcat\Nodes\Mime[]|array $mimes)
* @method \Naugrim\BMEcat\Nodes\Mime[]|array getMimes()
* @method self setPriceDetails(\Naugrim\BMEcat\Nodes\Product\PriceDetails|array $priceDetails)
* @method Naugrim\BMEcat\Nodes\Product\PriceDetails[] getPriceDetails()
* @method self setMimes(\Naugrim\BMEcat\Nodes\Mime|array $mimes)
* @method Naugrim\BMEcat\Nodes\Mime[] getMimes()
* @method self setLogisticDetails(array|\Naugrim\BMEcat\Nodes\Product\LogisticDetails $logisticDetails)
* @method \Naugrim\BMEcat\Nodes\Product\LogisticDetails getLogisticDetails()
* @method self setConfigDetails(array|\Naugrim\BMEcat\Nodes\Product\ConfigDetails $configDetails)
Expand Down
4 changes: 2 additions & 2 deletions src/Nodes/Product/Config/Parts.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

/**
* @implements NodeInterface<self>
* @method self setAlternatives(\Naugrim\BMEcat\Nodes\Product\Config\PartAlternative[]|array $alternatives)
* @method \Naugrim\BMEcat\Nodes\Product\Config\PartAlternative[]|array getAlternatives()
* @method self setAlternatives(\Naugrim\BMEcat\Nodes\Product\Config\PartAlternative|array $alternatives)
* @method Naugrim\BMEcat\Nodes\Product\Config\PartAlternative[] getAlternatives()
* @method self setSelectionType(string|null $selectionType)
* @method string|null getSelectionType()
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Nodes/Product/ConfigDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

/**
* @implements NodeInterface<self>
* @method self setSteps(\Naugrim\BMEcat\Nodes\Product\Config\Step[]|array $steps)
* @method \Naugrim\BMEcat\Nodes\Product\Config\Step[]|array getSteps()
* @method self setSteps(\Naugrim\BMEcat\Nodes\Product\Config\Step|array $steps)
* @method Naugrim\BMEcat\Nodes\Product\Config\Step[] getSteps()
*/
#[Serializer\XmlRoot('PRODUCT_CONFIG_DETAILS')]
class ConfigDetails implements Contracts\NodeInterface
Expand Down
20 changes: 10 additions & 10 deletions src/Nodes/Product/Details.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
* @method string|null getEan()
* @method self setSupplierAltPid(string|null $supplierAltPid)
* @method string|null getSupplierAltPid()
* @method self setBuyerPids(\Naugrim\BMEcat\Nodes\BuyerPidNode[]|array $buyerPids)
* @method \Naugrim\BMEcat\Nodes\BuyerPidNode[]|array getBuyerPids()
* @method self setBuyerPids(\Naugrim\BMEcat\Nodes\BuyerPidNode|array $buyerPids)
* @method Naugrim\BMEcat\Nodes\BuyerPidNode[] getBuyerPids()
* @method self setManufacturerPid(string|null $manufacturerPid)
* @method string|null getManufacturerPid()
* @method self setManufacturerIDRef(string|null $manufacturerIDRef)
Expand All @@ -34,20 +34,20 @@
* @method string|null getErpGroupSupplier()
* @method self setDeliveryTime(float|null $deliveryTime)
* @method float|null getDeliveryTime()
* @method self setSpecialTreatmentClasses(\Naugrim\BMEcat\Nodes\SpecialTreatmentClass[]|array $specialTreatmentClasses)
* @method \Naugrim\BMEcat\Nodes\SpecialTreatmentClass[]|array getSpecialTreatmentClasses()
* @method self setKeywords(\Naugrim\BMEcat\Nodes\Product\Keyword[]|array $keywords)
* @method \Naugrim\BMEcat\Nodes\Product\Keyword[]|array getKeywords()
* @method self setSpecialTreatmentClasses(\Naugrim\BMEcat\Nodes\SpecialTreatmentClass|array $specialTreatmentClasses)
* @method Naugrim\BMEcat\Nodes\SpecialTreatmentClass[] getSpecialTreatmentClasses()
* @method self setKeywords(\Naugrim\BMEcat\Nodes\Product\Keyword|array $keywords)
* @method Naugrim\BMEcat\Nodes\Product\Keyword[] getKeywords()
* @method self setRemarks(string|null $remarks)
* @method string|null getRemarks()
* @method self setSegment(string|null $segment)
* @method string|null getSegment()
* @method self setProductOrder(int|null $productOrder)
* @method int|null getProductOrder()
* @method self setProductStatus(\Naugrim\BMEcat\Nodes\Product\Status[]|array $productStatus)
* @method \Naugrim\BMEcat\Nodes\Product\Status[]|array getProductStatus()
* @method self setProductTypes(string $productTypes)
* @method string getProductTypes()
* @method self setProductStatus(\Naugrim\BMEcat\Nodes\Product\Status|array $productStatus)
* @method Naugrim\BMEcat\Nodes\Product\Status[] getProductStatus()
* @method self setProductTypes(array $productTypes)
* @method string[] getProductTypes()
*/
#[Serializer\XmlRoot('PRODUCT_DETAILS')]
class Details implements Contracts\NodeInterface
Expand Down
4 changes: 2 additions & 2 deletions src/Nodes/Product/Feature.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
* @implements NodeInterface<self>
* @method self setName(string $name)
* @method string getName()
* @method self setValue(string $value)
* @method string getValue()
* @method self setValue(array $value)
* @method string[] getValue()
* @method self setUnit(string|null $unit)
* @method string|null getUnit()
* @method self setOrder(int|null $order)
Expand Down
4 changes: 2 additions & 2 deletions src/Nodes/Product/Features.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* @method array|null getReferenceFeatureGroupId()
* @method self setReferenceFeatureGroupName(array|null $referenceFeatureGroupName)
* @method array|null getReferenceFeatureGroupName()
* @method self setFeatures(\Naugrim\BMEcat\Nodes\Product\Feature[]|array $features)
* @method \Naugrim\BMEcat\Nodes\Product\Feature[]|array getFeatures()
* @method self setFeatures(\Naugrim\BMEcat\Nodes\Product\Feature|array $features)
* @method Naugrim\BMEcat\Nodes\Product\Feature[] getFeatures()
*/
#[Serializer\XmlRoot('PRODUCT_FEATURES')]
class Features implements Contracts\NodeInterface
Expand Down
4 changes: 2 additions & 2 deletions src/Nodes/Product/Logistic/CustomsTariffNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* @implements Contracts\NodeInterface<self>
* @method self setNumber(string $number)
* @method string getNumber()
* @method self setTerritories(string $territories)
* @method string getTerritories()
* @method self setTerritories(array $territories)
* @method string[] getTerritories()
*/
#[Serializer\XmlRoot('CUSTOMS_TARIFF_NUMBER')]
class CustomsTariffNumber implements Contracts\NodeInterface
Expand Down
12 changes: 6 additions & 6 deletions src/Nodes/Product/LogisticDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@

/**
* @implements NodeInterface<self>
* @method self setCustomsTariffNumbers(\Naugrim\BMEcat\Nodes\Product\Logistic\CustomsTariffNumber[]|array $customsTariffNumbers)
* @method \Naugrim\BMEcat\Nodes\Product\Logistic\CustomsTariffNumber[]|array getCustomsTariffNumbers()
* @method self setCustomsTariffNumbers(\Naugrim\BMEcat\Nodes\Product\Logistic\CustomsTariffNumber|array $customsTariffNumbers)
* @method Naugrim\BMEcat\Nodes\Product\Logistic\CustomsTariffNumber[] getCustomsTariffNumbers()
* @method self setStatisticsFactor(float|null $statisticsFactor)
* @method float|null getStatisticsFactor()
* @method self setCountryOfOrigin(string $countryOfOrigin)
* @method string getCountryOfOrigin()
* @method self setCountryOfOrigin(array $countryOfOrigin)
* @method string[] getCountryOfOrigin()
* @method self setDimensions(null|array|\Naugrim\BMEcat\Nodes\Product\Logistic\Dimensions $dimensions)
* @method \Naugrim\BMEcat\Nodes\Product\Logistic\Dimensions|null getDimensions()
* @method self setDeliveryTimes(\Naugrim\BMEcat\Nodes\DeliveryTimes[]|array $deliveryTimes)
* @method \Naugrim\BMEcat\Nodes\DeliveryTimes[]|array getDeliveryTimes()
* @method self setDeliveryTimes(\Naugrim\BMEcat\Nodes\DeliveryTimes|array $deliveryTimes)
* @method Naugrim\BMEcat\Nodes\DeliveryTimes[] getDeliveryTimes()
*/
#[Serializer\XmlRoot('PRODUCT_LOGISTIC_DETAILS')]
class LogisticDetails implements Contracts\NodeInterface
Expand Down
4 changes: 2 additions & 2 deletions src/Nodes/Product/PriceDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* @method string getValidEndDate()
* @method self setDailyPrice(bool $dailyPrice)
* @method bool getDailyPrice()
* @method self setPrices(\Naugrim\BMEcat\Nodes\Product\Price[]|array $prices)
* @method \Naugrim\BMEcat\Nodes\Product\Price[]|array getPrices()
* @method self setPrices(\Naugrim\BMEcat\Nodes\Product\Price|array $prices)
* @method Naugrim\BMEcat\Nodes\Product\Price[] getPrices()
*/
#[Serializer\XmlRoot('PRODUCT_PRICE_DETAILS')]
class PriceDetails implements Contracts\NodeInterface
Expand Down
4 changes: 2 additions & 2 deletions src/Nodes/TimeSpan.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* @method string|null getValueStart()
* @method self setValueEnd(string|null $valueEnd)
* @method string|null getValueEnd()
* @method self setSubTimeSpans(\Naugrim\BMEcat\Nodes\TimeSpan[]|array $subTimeSpans)
* @method \Naugrim\BMEcat\Nodes\TimeSpan[]|array getSubTimeSpans()
* @method self setSubTimeSpans(\Naugrim\BMEcat\Nodes\TimeSpan|array $subTimeSpans)
* @method Naugrim\BMEcat\Nodes\TimeSpan[] getSubTimeSpans()
*/
#[Serializer\XmlRoot('TimeSpan')]
class TimeSpan implements Contracts\NodeInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,10 @@ public function refactor(Node $node): ?Node
$value = $attr->args[0]->value;
if ($value instanceof Node\Scalar\String_) {
if (preg_match('/^array<(?<inner>.*)>/', $value->value, $match) === 1) {
$propertyType = $match['inner'];
if (str_contains($propertyType, "\\")) {
$propertyType = "\\".$propertyType."[]|array";
if (str_contains($match['inner'], "\\")) {
$propertyType = "\\".$match['inner']."|array";
}
$getterReturnType = $propertyType;
$getterReturnType = $match['inner']."[]";
break 2;
}
} elseif ($value instanceof Node\Expr\BinaryOp\Concat && $value->left->left->value === 'array<' && $value->left->right instanceof Node\Expr\ClassConstFetch) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ class Address implements NodeInterface
#[Serializer\Type(PublicKey::class)]
#[Serializer\SerializedName('NON_NULLABLE')]
protected PublicKey $nonNullableTest;

/**
* @var string[]
*/
#[Serializer\Expose]
#[Serializer\Type('array<string>')]
#[Serializer\SerializedName('SOME_STRING_ARRAY')]
protected array $someStringArray = [];
}
?>
-----
Expand All @@ -56,6 +64,8 @@ use Naugrim\BMEcat\Nodes\Crypto\PublicKey;
* @method \Naugrim\BMEcat\Nodes\Crypto\PublicKey|null getPublicKey()
* @method self setNonNullableTest(array|\Naugrim\BMEcat\Nodes\Crypto\PublicKey $nonNullableTest)
* @method \Naugrim\BMEcat\Nodes\Crypto\PublicKey getNonNullableTest()
* @method self setSomeStringArray(array $someStringArray)
* @method string[] getSomeStringArray()
*/
class Address implements NodeInterface
{
Expand Down Expand Up @@ -83,5 +93,13 @@ class Address implements NodeInterface
#[Serializer\Type(PublicKey::class)]
#[Serializer\SerializedName('NON_NULLABLE')]
protected PublicKey $nonNullableTest;

/**
* @var string[]
*/
#[Serializer\Expose]
#[Serializer\Type('array<string>')]
#[Serializer\SerializedName('SOME_STRING_ARRAY')]
protected array $someStringArray = [];
}
?>

0 comments on commit f3de519

Please sign in to comment.