Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions generator/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ public static function resolveParameterType(Schema|Reference $property): string
} elseif ('object' === $property->type) {
$properties = [];
foreach ($property->properties as $parameterName => $propertyValue) {
$properties[] = \sprintf('%s?: %s%s', $parameterName, self::resolveParameterType($propertyValue), $propertyValue->nullable ?? false ? '|null' : '');
$properties[] = \sprintf('%s?: %s', $parameterName, self::resolveParameterType($propertyValue));
}

$type = \sprintf('array{%s}', implode(', ', $properties));
} else {
$type = $property->type;
$type = $property->type.($property->nullable ? '|null' : '');
}

return $type;
Expand All @@ -88,7 +88,7 @@ public static function makePhpDoc(array $properties, string $format): array
}

if ($property instanceof Schema) {
$parameters[] = \sprintf($format, \sprintf('%s?: %s|null', $name, self::resolveParameterType($property)));
$parameters[] = \sprintf($format, \sprintf('%s?: %s', $name, self::resolveParameterType($property)));
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/Requests/V10/AppointmentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class AppointmentRequest extends Request
{
/**
* @param array{
* SkipRecords?: int|null,
* TakeRecords?: int|null,
* SkipRecords?: int,
* TakeRecords?: int,
* } $parameters
*
* @return \Generator<array-key, Agenda>
Expand All @@ -33,7 +33,7 @@ public function getAgendas(array $parameters = []): \Generator
/**
* @param array{
* Subject?: string|null,
* AppointmentIds?: array<int>|null,
* AppointmentIds?: array<int>,
* HasITS?: bool|null,
* ITS_Id?: int|null,
* DebtorId?: int|null,
Expand All @@ -43,8 +43,8 @@ public function getAgendas(array $parameters = []): \Generator
* TaskForUserId?: int|null,
* StartDateTimeFrom?: string|null,
* StartDateTimeUntil?: string|null,
* SkipRecords?: int|null,
* TakeRecords?: int|null,
* SkipRecords?: int,
* TakeRecords?: int,
* } $parameters
*
* @return \Generator<array-key, Appointment>
Expand Down
2 changes: 1 addition & 1 deletion src/Requests/V10/BackOfficeRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function getDatabaseConfiguration(
* Maak een nieuwe taak aan.
*
* @param array{
* Type?: string|null,
* Type?: string,
* SerializedJson?: string|null,
* } $parameters
*
Expand Down
12 changes: 6 additions & 6 deletions src/Requests/V10/BuyOrderDeliveryRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ class BuyOrderDeliveryRequest extends Request
* Maak een nieuwe inkooplevering aan of update een bestaande.
*
* @param array{
* ProcessMutationButDoNotCreatePickbon?: bool|null,
* Status?: string|null,
* ProcessMutationButDoNotCreatePickbon?: bool,
* Status?: string,
* SupplierId?: int|null,
* BuyOrderId?: int|null,
* Remarks?: string|null,
* Description?: string|null,
* BranchId?: int|null,
* Rows?: array<array{BuyOrderRowId?: int|null, BuyPrice?: number|null, DebtorName?: string|null, OrderId?: int|null, ProductId?: int, Qty_Delivered?: number, Remarks?: string|null, StockLocationId?: int|null, AmountOfLabelsToPrint?: int|null}>|null,
* Rows?: array<array{BuyOrderRowId?: int|null, BuyPrice?: number|null, DebtorName?: string|null, OrderId?: int|null, ProductId?: int, Qty_Delivered?: number, Remarks?: string|null, StockLocationId?: int|null, AmountOfLabelsToPrint?: int|null}>,
* PickingListNumber?: string|null,
* } $parameters
*
Expand All @@ -47,14 +47,14 @@ public function createBuyOrderDelivery(
*
* @param array{
* OrderId?: int|null,
* ProcessMutationButDoNotCreatePickbon?: bool|null,
* Status?: string|null,
* ProcessMutationButDoNotCreatePickbon?: bool,
* Status?: string,
* SupplierId?: int|null,
* BuyOrderId?: int|null,
* Remarks?: string|null,
* Description?: string|null,
* BranchId?: int|null,
* Rows?: array<array{BuyOrderRowId?: int|null, BuyPrice?: number|null, DebtorName?: string|null, OrderId?: int|null, ProductId?: int, Qty_Delivered?: number, Remarks?: string|null, StockLocationId?: int|null, AmountOfLabelsToPrint?: int|null}>|null,
* Rows?: array<array{BuyOrderRowId?: int|null, BuyPrice?: number|null, DebtorName?: string|null, OrderId?: int|null, ProductId?: int, Qty_Delivered?: number, Remarks?: string|null, StockLocationId?: int|null, AmountOfLabelsToPrint?: int|null}>,
* PickingListNumber?: string|null,
* } $parameters
*
Expand Down
40 changes: 20 additions & 20 deletions src/Requests/V10/BuyOrderRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ class BuyOrderRequest extends Request
* Voeg een nieuwe inkooporderregel aan een bestaande inkooporder.
*
* @param array{
* BuyOrderId?: int|null,
* BuyOrderId?: int,
* OrderId?: int|null,
* ProductCode?: string|null,
* ProductId?: int|null,
* Price?: number|null,
* Price?: number,
* Description?: string|null,
* ProductDesc2?: string|null,
* ExpectedDeliveryDate?: string|null,
* QtyToOrder?: number|null,
* QtyToOrder?: number,
* OrderedOnDateByDistributor?: string|null,
* OrderRowId?: int|null,
* InternalNote?: string|null,
Expand All @@ -47,10 +47,10 @@ public function addBuyOrderRow(array $parameters = []): BooleanLogic4Response
* Voeg een nieuwe inkooporderregel toe of update een bestaande regel.
*
* @param array{
* BuyOrderRowId?: int|null,
* BuyOrderId?: int|null,
* BuyOrderRowId?: int,
* BuyOrderId?: int,
* DebtorName?: string|null,
* QtyToDeliver?: number|null,
* QtyToDeliver?: number,
* CreditorProductCode?: string|null,
* ProductDesc1?: string|null,
* StandardAmountQTY?: number|null,
Expand All @@ -59,11 +59,11 @@ public function addBuyOrderRow(array $parameters = []): BooleanLogic4Response
* OrderId?: int|null,
* ProductCode?: string|null,
* ProductId?: int|null,
* Price?: number|null,
* Price?: number,
* Description?: string|null,
* ProductDesc2?: string|null,
* ExpectedDeliveryDate?: string|null,
* QtyToOrder?: number|null,
* QtyToOrder?: number,
* OrderedOnDateByDistributor?: string|null,
* OrderRowId?: int|null,
* InternalNote?: string|null,
Expand All @@ -87,10 +87,10 @@ public function addUpdateBuyOrderRow(
* Maak een nieuwe inkooporder.
*
* @param array{
* CreditorId?: int|null,
* DatabaseAdministrationId?: int|null,
* CreatedAt?: string|null,
* BuyOrderRows?: array<array{BuyOrderRowId?: int, BuyOrderId?: int, DebtorName?: string|null, QtyToDeliver?: number, CreditorProductCode?: string|null, ProductDesc1?: string|null, StandardAmountQTY?: number|null, StandardAmountQTYUnitId?: int|null, RepackingQty?: int|null, OrderId?: int|null, ProductCode?: string|null, ProductId?: int|null, Price?: number, Description?: string|null, ProductDesc2?: string|null, ExpectedDeliveryDate?: string|null, QtyToOrder?: number, OrderedOnDateByDistributor?: string|null, OrderRowId?: int|null, InternalNote?: string|null}>|null,
* CreditorId?: int,
* DatabaseAdministrationId?: int,
* CreatedAt?: string,
* BuyOrderRows?: array<array{BuyOrderRowId?: int, BuyOrderId?: int, DebtorName?: string|null, QtyToDeliver?: number, CreditorProductCode?: string|null, ProductDesc1?: string|null, StandardAmountQTY?: number|null, StandardAmountQTYUnitId?: int|null, RepackingQty?: int|null, OrderId?: int|null, ProductCode?: string|null, ProductId?: int|null, Price?: number, Description?: string|null, ProductDesc2?: string|null, ExpectedDeliveryDate?: string|null, QtyToOrder?: number, OrderedOnDateByDistributor?: string|null, OrderRowId?: int|null, InternalNote?: string|null}>,
* Remarks?: string|null,
* BranchId?: int|null,
* OrderId?: int|null,
Expand Down Expand Up @@ -155,7 +155,7 @@ public function getBuyOrderRowsByFilter(
* Haal per artikel openstaande inkoopordersregels op o.b.v. het meegestuurde filter.
*
* @param array{
* ProductIds?: array<int>|null,
* ProductIds?: array<int>,
* Dropshipment?: bool|null,
* MinimumDeliveryDate?: string|null,
* } $parameters
Expand Down Expand Up @@ -207,12 +207,12 @@ public function getBuyOrders(
* Wijzig een bestaande inkooporder.
*
* @param array{
* Id?: int|null,
* CreditorId?: int|null,
* Id?: int,
* CreditorId?: int,
* Remarks?: string|null,
* BranchId?: int|null,
* BuyOrderClosed?: bool|null,
* CreatedAt?: string|null,
* BuyOrderClosed?: bool,
* CreatedAt?: string,
* } $parameters
*
* @throws Logic4ApiException
Expand All @@ -231,15 +231,15 @@ public function updateBuyOrder(
* Update een bestaande inkooporderregel.
*
* @param array{
* BuyOrderRowId?: int|null,
* BuyOrderRowId?: int,
* OrderId?: int|null,
* ProductCode?: string|null,
* ProductId?: int|null,
* Price?: number|null,
* Price?: number,
* Description?: string|null,
* ProductDesc2?: string|null,
* ExpectedDeliveryDate?: string|null,
* QtyToOrder?: number|null,
* QtyToOrder?: number,
* OrderedOnDateByDistributor?: string|null,
* OrderRowId?: int|null,
* InternalNote?: string|null,
Expand Down
10 changes: 5 additions & 5 deletions src/Requests/V10/CRMRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class CRMRequest extends Request
* CrmProjectId?: int|null,
* CreatedDateFrom?: string|null,
* CreatedDateTo?: string|null,
* StatusIds?: array<int>|null,
* CreatedByUserIds?: array<int>|null,
* StatusIds?: array<int>,
* CreatedByUserIds?: array<int>,
* CarriedOutByUserId?: int|null,
* StartDateFrom?: string|null,
* StartDateTo?: string|null,
Expand All @@ -34,7 +34,7 @@ class CRMRequest extends Request
* CrmProjectName?: string|null,
* ShowOnlyOpenActivities?: bool|null,
* UserIdForRights?: int|null,
* CarriedOutByUserIds?: array<int>|null,
* CarriedOutByUserIds?: array<int>,
* } $parameters
*
* @throws Logic4ApiException
Expand Down Expand Up @@ -86,8 +86,8 @@ public function getCRMActivityTypes(): CRMActivityTypeLogic4ResponseList
* CrmProjectId?: int|null,
* StartDate?: string|null,
* EndDate?: string|null,
* StatusIds?: array<int>|null,
* ResponsibleUserIds?: array<int>|null,
* StatusIds?: array<int>,
* ResponsibleUserIds?: array<int>,
* Name?: string|null,
* TypeId?: int|null,
* UserIdForRights?: int|null,
Expand Down
6 changes: 3 additions & 3 deletions src/Requests/V10/DeliveryRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class DeliveryRequest extends Request
* Maak een nieuwe uitlevering aan o.b.v. opgestuurde orderregels. Het systeem bepaalt automatisch vanaf welke voorraadlocatie de voorraad afgeboekt wordt.
*
* @param array{
* DeliveryRows?: array<array{RowId?: int, AmountToDeliver?: number}>|null,
* DeliveryRows?: array<array{RowId?: int, AmountToDeliver?: number}>,
* } $parameters
*
* @throws Logic4ApiException
Expand All @@ -40,8 +40,8 @@ public function createDeliveryForOrderRows(
* OrderStatusId?: int|null,
* BranchId?: int|null,
* WebsiteDomainId?: int|null,
* Skip?: int|null,
* Take?: int|null,
* Skip?: int,
* Take?: int,
* } $parameters
*
* @return \Generator<array-key, SalesOrderDelivery>
Expand Down
Loading