diff --git a/src/main/edu/wisc/services/cbs/order/line/MockOrderLineService.php b/src/main/edu/wisc/services/cbs/order/line/MockOrderLineService.php index 69f3d29a1b43fdab5b2c0b48439addb3d1683138..b49f98be9ab5d5d0805f2b65b1289b3de3ced1cc 100644 --- a/src/main/edu/wisc/services/cbs/order/line/MockOrderLineService.php +++ b/src/main/edu/wisc/services/cbs/order/line/MockOrderLineService.php @@ -21,7 +21,7 @@ class MockOrderLineService implements OrderLineService, MockService } /** @inheritdoc */ - public function createOrderLine(OrderLine $orderLine) + public function createOrderLine(OrderLine $orderLine): OrderServiceResponse { return $this->response; } diff --git a/src/main/edu/wisc/services/cbs/order/line/OrderLine.php b/src/main/edu/wisc/services/cbs/order/line/OrderLine.php index 020c61568d840e5a19b8699cb498f053ed910d97..bef1a78d8000f44ea23baf6ec1cd7033196fbf23 100644 --- a/src/main/edu/wisc/services/cbs/order/line/OrderLine.php +++ b/src/main/edu/wisc/services/cbs/order/line/OrderLine.php @@ -10,7 +10,7 @@ use Money\Money; class OrderLine extends MagentoOrder { - /** @var int order number - foreign key {@link OrderHeader::getOrderNumber} */ + /** @var float order number - foreign key {@link OrderHeader::getOrderNumber} */ private $orderNumber; /** @var string "MAGE" + order number */ @@ -19,7 +19,7 @@ class OrderLine extends MagentoOrder /** @var string always STANDARD */ private $lineType = 'STANDARD'; - /** @var int the sequence in which to be placed in the order */ + /** @var float the sequence in which to be placed in the order */ private $lineNumber; /** @var string Format "MAGE" + Magento order number + "-" + $lineNumber */ @@ -31,7 +31,7 @@ class OrderLine extends MagentoOrder /** @var string SKU */ private $itemNumber; - /** @var int quantity purchased */ + /** @var float quantity purchased */ private $quantity; /** @var Money price per unit */ @@ -43,10 +43,10 @@ class OrderLine extends MagentoOrder /** @var string name of discount */ private $promoDiscountName; - /** @var int (optional) */ + /** @var float (optional) */ private $bundleId; - /** @var int (optional) */ + /** @var float (optional) */ private $bundleLineId; /** @var string */ @@ -85,7 +85,7 @@ class OrderLine extends MagentoOrder /** @var string shipping instructions (optional) */ private $shippingInstructions; - /** @var int (optional) */ + /** @var float (optional) */ private $shipSetId; /** @var float */ @@ -95,18 +95,18 @@ class OrderLine extends MagentoOrder private $testMode; /** - * @return int + * @return float */ - public function getOrderNumber() + public function getOrderNumber(): float { return $this->orderNumber; } /** - * @param int $orderNumber + * @param float $orderNumber * @return OrderLine */ - public function setOrderNumber($orderNumber) + public function setOrderNumber(float $orderNumber): OrderLine { $this->orderNumber = $orderNumber; return $this; @@ -115,7 +115,7 @@ class OrderLine extends MagentoOrder /** * @return string */ - public function getOrigSysDocumentRef() + public function getOrigSysDocumentRef(): string { return $this->origSysDocumentRef; } @@ -124,7 +124,7 @@ class OrderLine extends MagentoOrder * @param string $origSysDocumentRef * @return OrderLine */ - public function setOrigSysDocumentRef($origSysDocumentRef) + public function setOrigSysDocumentRef(string $origSysDocumentRef): OrderLine { $this->origSysDocumentRef = $origSysDocumentRef; return $this; @@ -133,7 +133,7 @@ class OrderLine extends MagentoOrder /** * @return string */ - public function getLineType() + public function getLineType(): string { return $this->lineType; } @@ -142,25 +142,25 @@ class OrderLine extends MagentoOrder * @param string $lineType * @return OrderLine */ - public function setLineType($lineType) + public function setLineType(string $lineType): OrderLine { $this->lineType = $lineType; return $this; } /** - * @return int + * @return float */ - public function getLineNumber() + public function getLineNumber(): float { return $this->lineNumber; } /** - * @param int $lineNumber + * @param float $lineNumber * @return OrderLine */ - public function setLineNumber($lineNumber) + public function setLineNumber(float $lineNumber): OrderLine { $this->lineNumber = $lineNumber; return $this; @@ -169,7 +169,7 @@ class OrderLine extends MagentoOrder /** * @return string */ - public function getOrigSysLineRef() + public function getOrigSysLineRef(): string { return $this->origSysLineRef; } @@ -178,7 +178,7 @@ class OrderLine extends MagentoOrder * @param string $origSysLineRef * @return OrderLine */ - public function setOrigSysLineRef($origSysLineRef) + public function setOrigSysLineRef(string $origSysLineRef): OrderLine { $this->origSysLineRef = $origSysLineRef; return $this; @@ -187,7 +187,7 @@ class OrderLine extends MagentoOrder /** * @return string */ - public function getItemNumberType() + public function getItemNumberType(): string { return $this->itemNumberType; } @@ -196,7 +196,7 @@ class OrderLine extends MagentoOrder * @param string $itemNumberType * @return OrderLine */ - public function setItemNumberType($itemNumberType) + public function setItemNumberType(string $itemNumberType): OrderLine { $this->itemNumberType = $itemNumberType; return $this; @@ -205,7 +205,7 @@ class OrderLine extends MagentoOrder /** * @return string */ - public function getItemNumber() + public function getItemNumber(): string { return $this->itemNumber; } @@ -214,25 +214,25 @@ class OrderLine extends MagentoOrder * @param string $itemNumber * @return OrderLine */ - public function setItemNumber($itemNumber) + public function setItemNumber(string $itemNumber): OrderLine { $this->itemNumber = $itemNumber; return $this; } /** - * @return int + * @return float */ - public function getQuantity() + public function getQuantity(): float { return $this->quantity; } /** - * @param int $quantity + * @param float $quantity * @return OrderLine */ - public function setQuantity($quantity) + public function setQuantity(float $quantity): OrderLine { $this->quantity = $quantity; return $this; @@ -241,7 +241,7 @@ class OrderLine extends MagentoOrder /** * @return Money */ - public function getUnitPrice() + public function getUnitPrice(): Money { return $this->unitPrice; } @@ -250,43 +250,43 @@ class OrderLine extends MagentoOrder * @param Money $unitPrice * @return OrderLine */ - public function setUnitPrice(Money $unitPrice) + public function setUnitPrice(Money $unitPrice): OrderLine { $this->unitPrice = $unitPrice; return $this; } /** - * @return int + * @return float */ - public function getBundleId() + public function getBundleId(): float { return $this->bundleId; } /** - * @param int $bundleId + * @param float $bundleId * @return OrderLine */ - public function setBundleId($bundleId) + public function setBundleId(float $bundleId): OrderLine { $this->bundleId = $bundleId; return $this; } /** - * @return int + * @return float */ - public function getBundleLineId() + public function getBundleLineId(): float { return $this->bundleLineId; } /** - * @param int $bundleLineId + * @param float $bundleLineId * @return OrderLine */ - public function setBundleLineId($bundleLineId) + public function setBundleLineId(float $bundleLineId): OrderLine { $this->bundleLineId = $bundleLineId; return $this; @@ -295,7 +295,7 @@ class OrderLine extends MagentoOrder /** * @return string */ - public function getDeliveryMethod() + public function getDeliveryMethod(): string { return $this->deliveryMethod; } @@ -304,7 +304,7 @@ class OrderLine extends MagentoOrder * @param string $deliveryMethod * @return OrderLine */ - public function setDeliveryMethod($deliveryMethod) + public function setDeliveryMethod(string $deliveryMethod): OrderLine { $this->deliveryMethod = $deliveryMethod; return $this; @@ -313,7 +313,7 @@ class OrderLine extends MagentoOrder /** * @return \DateTime */ - public function getShipDate() + public function getShipDate(): \DateTime { return $this->shipDate; } @@ -322,7 +322,7 @@ class OrderLine extends MagentoOrder * @param \DateTime $shipDate * @return OrderLine */ - public function setShipDate($shipDate) + public function setShipDate(\DateTime $shipDate): OrderLine { $this->shipDate = $shipDate; return $this; @@ -331,7 +331,7 @@ class OrderLine extends MagentoOrder /** * @return string */ - public function getShipToIdentifier() + public function getShipToIdentifier(): string { return $this->shipToIdentifier; } @@ -340,7 +340,7 @@ class OrderLine extends MagentoOrder * @param string $shipToIdentifier * @return OrderLine */ - public function setShipToIdentifier($shipToIdentifier) + public function setShipToIdentifier(string $shipToIdentifier): OrderLine { $this->shipToIdentifier = $shipToIdentifier; return $this; @@ -349,7 +349,7 @@ class OrderLine extends MagentoOrder /** * @return string */ - public function getShipToIdentifierType() + public function getShipToIdentifierType(): string { return $this->shipToIdentifierType; } @@ -358,7 +358,7 @@ class OrderLine extends MagentoOrder * @param string $shipToIdentifierType * @return OrderLine */ - public function setShipToIdentifierType($shipToIdentifierType) + public function setShipToIdentifierType(string $shipToIdentifierType): OrderLine { $this->shipToIdentifierType = $shipToIdentifierType; return $this; @@ -367,7 +367,7 @@ class OrderLine extends MagentoOrder /** * @return string */ - public function getShipToAddress1() + public function getShipToAddress1(): string { return $this->shipToAddress1; } @@ -376,7 +376,7 @@ class OrderLine extends MagentoOrder * @param string $shipToAddress1 * @return OrderLine */ - public function setShipToAddress1($shipToAddress1) + public function setShipToAddress1(string $shipToAddress1): OrderLine { $this->shipToAddress1 = $shipToAddress1; return $this; @@ -385,7 +385,7 @@ class OrderLine extends MagentoOrder /** * @return string */ - public function getShipToAddress2() + public function getShipToAddress2(): string { return $this->shipToAddress2; } @@ -394,7 +394,7 @@ class OrderLine extends MagentoOrder * @param string $shipToAddress2 * @return OrderLine */ - public function setShipToAddress2($shipToAddress2) + public function setShipToAddress2(string $shipToAddress2): OrderLine { $this->shipToAddress2 = $shipToAddress2; return $this; @@ -403,7 +403,7 @@ class OrderLine extends MagentoOrder /** * @return string */ - public function getShipToAddress3() + public function getShipToAddress3(): string { return $this->shipToAddress3; } @@ -412,7 +412,7 @@ class OrderLine extends MagentoOrder * @param string $shipToAddress3 * @return OrderLine */ - public function setShipToAddress3($shipToAddress3) + public function setShipToAddress3(string $shipToAddress3): OrderLine { $this->shipToAddress3 = $shipToAddress3; return $this; @@ -421,7 +421,7 @@ class OrderLine extends MagentoOrder /** * @return string */ - public function getShipToAddress4() + public function getShipToAddress4(): string { return $this->shipToAddress4; } @@ -430,7 +430,7 @@ class OrderLine extends MagentoOrder * @param string $shipToAddress4 * @return OrderLine */ - public function setShipToAddress4($shipToAddress4) + public function setShipToAddress4(string $shipToAddress4): OrderLine { $this->shipToAddress4 = $shipToAddress4; return $this; @@ -439,7 +439,7 @@ class OrderLine extends MagentoOrder /** * @return string */ - public function getShipToCity() + public function getShipToCity(): string { return $this->shipToCity; } @@ -448,7 +448,7 @@ class OrderLine extends MagentoOrder * @param string $shipToCity * @return OrderLine */ - public function setShipToCity($shipToCity) + public function setShipToCity(string $shipToCity): OrderLine { $this->shipToCity = $shipToCity; return $this; @@ -457,7 +457,7 @@ class OrderLine extends MagentoOrder /** * @return string */ - public function getShipToState() + public function getShipToState(): string { return $this->shipToState; } @@ -466,7 +466,7 @@ class OrderLine extends MagentoOrder * @param string $shipToState * @return OrderLine */ - public function setShipToState($shipToState) + public function setShipToState(string $shipToState): OrderLine { $this->shipToState = $shipToState; return $this; @@ -475,7 +475,7 @@ class OrderLine extends MagentoOrder /** * @return string */ - public function getShipToPostalCode() + public function getShipToPostalCode(): string { return $this->shipToPostalCode; } @@ -484,7 +484,7 @@ class OrderLine extends MagentoOrder * @param string $shipToPostalCode * @return OrderLine */ - public function setShipToPostalCode($shipToPostalCode) + public function setShipToPostalCode(string $shipToPostalCode): OrderLine { $this->shipToPostalCode = $shipToPostalCode; return $this; @@ -493,7 +493,7 @@ class OrderLine extends MagentoOrder /** * @return string */ - public function getShippingInstructions() + public function getShippingInstructions(): string { return $this->shippingInstructions; } @@ -502,25 +502,25 @@ class OrderLine extends MagentoOrder * @param string $shippingInstructions * @return OrderLine */ - public function setShippingInstructions($shippingInstructions) + public function setShippingInstructions(string $shippingInstructions): OrderLine { $this->shippingInstructions = $shippingInstructions; return $this; } /** - * @return int + * @return float */ - public function getShipSetId() + public function getShipSetId(): float { return $this->shipSetId; } /** - * @param int $shipSetId + * @param float $shipSetId * @return OrderLine */ - public function setShipSetId($shipSetId) + public function setShipSetId(float $shipSetId): OrderLine { $this->shipSetId = $shipSetId; return $this; @@ -529,7 +529,7 @@ class OrderLine extends MagentoOrder /** * @return float */ - public function getUserId() + public function getUserId(): float { return $this->userId; } @@ -538,7 +538,7 @@ class OrderLine extends MagentoOrder * @param float $userId * @return OrderLine */ - public function setUserId($userId) + public function setUserId(float $userId): OrderLine { $this->userId = $userId; return $this; @@ -547,7 +547,7 @@ class OrderLine extends MagentoOrder /** * @return string */ - public function getTestMode() + public function getTestMode(): string { return $this->testMode; } @@ -556,7 +556,7 @@ class OrderLine extends MagentoOrder * @param string $testMode * @return OrderLine */ - public function setTestMode($testMode) + public function setTestMode(string $testMode): OrderLine { $this->testMode = $testMode; return $this; @@ -565,7 +565,7 @@ class OrderLine extends MagentoOrder /** * @return Money */ - public function getUnitPromoPrice() + public function getUnitPromoPrice(): Money { return $this->unitPromoPrice; } @@ -574,7 +574,7 @@ class OrderLine extends MagentoOrder * @param Money $unitPromoPrice * @return OrderLine */ - public function setUnitPromoPrice($unitPromoPrice) + public function setUnitPromoPrice(Money $unitPromoPrice): OrderLine { $this->unitPromoPrice = $unitPromoPrice; return $this; @@ -583,7 +583,7 @@ class OrderLine extends MagentoOrder /** * @return string */ - public function getPromoDiscountName() + public function getPromoDiscountName(): string { return $this->promoDiscountName; } @@ -592,7 +592,7 @@ class OrderLine extends MagentoOrder * @param string $promoDiscountName * @return OrderLine */ - public function setPromoDiscountName($promoDiscountName) + public function setPromoDiscountName(string $promoDiscountName): OrderLine { $this->promoDiscountName = $promoDiscountName; return $this; diff --git a/src/main/edu/wisc/services/cbs/order/line/OrderLineInputParametersMapper.php b/src/main/edu/wisc/services/cbs/order/line/OrderLineInputParametersMapper.php index 392bbe9f69324f21003b4985c1dc3d888f236fa4..24afd161cde4b925dfebbf078ade237184d223b9 100644 --- a/src/main/edu/wisc/services/cbs/order/line/OrderLineInputParametersMapper.php +++ b/src/main/edu/wisc/services/cbs/order/line/OrderLineInputParametersMapper.php @@ -11,7 +11,7 @@ use edu\wisc\services\cbs\order\line\generated\InputParameters; class OrderLineInputParametersMapper { - public static function toInputParameters(OrderLine $lineItem) + public static function toInputParameters(OrderLine $lineItem): InputParameters { return (new InputParameters( 0.0, diff --git a/src/main/edu/wisc/services/cbs/order/line/OrderLineService.php b/src/main/edu/wisc/services/cbs/order/line/OrderLineService.php index 76ba6e6556bb970d45c627f14c784382f0d57cb7..c0edd449fcf3190be928d81b1f08464dbaa10f29 100644 --- a/src/main/edu/wisc/services/cbs/order/line/OrderLineService.php +++ b/src/main/edu/wisc/services/cbs/order/line/OrderLineService.php @@ -2,6 +2,7 @@ namespace edu\wisc\services\cbs\order\line; use edu\wisc\services\cbs\api\Service; +use edu\wisc\services\cbs\order\OrderServiceResponse; interface OrderLineService extends Service { @@ -12,6 +13,6 @@ interface OrderLineService extends Service * @param OrderLine $orderLine * @return OrderServiceResponse */ - public function createOrderLine(OrderLine $orderLine); + public function createOrderLine(OrderLine $orderLine): OrderServiceResponse; } diff --git a/src/main/edu/wisc/services/cbs/order/line/SoapOrderLineService.php b/src/main/edu/wisc/services/cbs/order/line/SoapOrderLineService.php index 7eb2020c8874af4cab1aa595d54857dffebfd992..2938c29c87eed42415a72b303083a9f225563174 100644 --- a/src/main/edu/wisc/services/cbs/order/line/SoapOrderLineService.php +++ b/src/main/edu/wisc/services/cbs/order/line/SoapOrderLineService.php @@ -48,7 +48,7 @@ class SoapOrderLineService implements SoapService, OrderLineService /** * {@inheritdoc} */ - public function createOrderLine(OrderLine $orderLine) + public function createOrderLine(OrderLine $orderLine): OrderServiceResponse { $outputParameters = $this->soapClient->LINE_CREATE( OrderLineInputParametersMapper::toInputParameters($orderLine)