From 9ef16c43f523818124322d2755b9c4925bb37fac Mon Sep 17 00:00:00 2001 From: lfolco Date: Tue, 9 Feb 2021 12:01:17 -0500 Subject: [PATCH 1/2] return objects from fixture (#66) --- src/Catalog/ProductFixture.php | 5 +++++ src/Customer/CustomerFixture.php | 5 +++++ src/Sales/CreditmemoFixture.php | 5 +++++ src/Sales/InvoiceFixture.php | 5 +++++ src/Sales/OrderFixture.php | 5 +++++ src/Sales/ShipmentFixture.php | 5 +++++ 6 files changed, 30 insertions(+) diff --git a/src/Catalog/ProductFixture.php b/src/Catalog/ProductFixture.php index d0c1bf4..dcf9c45 100644 --- a/src/Catalog/ProductFixture.php +++ b/src/Catalog/ProductFixture.php @@ -17,6 +17,11 @@ public function __construct(ProductInterface $product) $this->product = $product; } + public function getProduct(): ProductInterface + { + return $this->product; + } + public function getId(): int { return (int) $this->product->getId(); diff --git a/src/Customer/CustomerFixture.php b/src/Customer/CustomerFixture.php index d799920..ce2ff6b 100644 --- a/src/Customer/CustomerFixture.php +++ b/src/Customer/CustomerFixture.php @@ -23,6 +23,11 @@ public function __construct(CustomerInterface $customer) $this->customer = $customer; } + public function getCustomer(): CustomerInterface + { + return $this->customer; + } + public function getDefaultShippingAddressId(): int { return (int) $this->customer->getDefaultShipping(); diff --git a/src/Sales/CreditmemoFixture.php b/src/Sales/CreditmemoFixture.php index 85e5c09..717f4b7 100644 --- a/src/Sales/CreditmemoFixture.php +++ b/src/Sales/CreditmemoFixture.php @@ -17,6 +17,11 @@ public function __construct(CreditmemoInterface $creditmemo) $this->creditmemo = $creditmemo; } + public function getCreditmemo(): int + { + return $this->creditmemo; + } + public function getId(): int { return (int) $this->creditmemo->getEntityId(); diff --git a/src/Sales/InvoiceFixture.php b/src/Sales/InvoiceFixture.php index 9fcab29..ad2bac3 100644 --- a/src/Sales/InvoiceFixture.php +++ b/src/Sales/InvoiceFixture.php @@ -17,6 +17,11 @@ public function __construct(InvoiceInterface $shipment) $this->invoice = $shipment; } + public function getInvoice(): int + { + return $this->invoice; + } + public function getId(): int { return (int) $this->invoice->getEntityId(); diff --git a/src/Sales/OrderFixture.php b/src/Sales/OrderFixture.php index 4a06b86..ca11293 100644 --- a/src/Sales/OrderFixture.php +++ b/src/Sales/OrderFixture.php @@ -17,6 +17,11 @@ public function __construct(Order $order) $this->order = $order; } + public function getOrder(): OrderInterface + { + return $this->order; + } + public function getId(): int { return (int) $this->order->getEntityId(); diff --git a/src/Sales/ShipmentFixture.php b/src/Sales/ShipmentFixture.php index 38823b4..ad74823 100644 --- a/src/Sales/ShipmentFixture.php +++ b/src/Sales/ShipmentFixture.php @@ -17,6 +17,11 @@ public function __construct(ShipmentInterface $shipment) $this->shipment = $shipment; } + public function getShipment(): ShipmentInterface + { + return $this->shipment; + } + public function getId(): int { return (int) $this->shipment->getEntityId(); From 4f18be5757b738009d36d538cd84ad8566e6b743 Mon Sep 17 00:00:00 2001 From: lfolco Date: Tue, 9 Feb 2021 13:21:04 -0500 Subject: [PATCH 2/2] fix return types (#66) --- src/Sales/CreditmemoFixture.php | 2 +- src/Sales/InvoiceFixture.php | 2 +- src/Sales/OrderFixture.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Sales/CreditmemoFixture.php b/src/Sales/CreditmemoFixture.php index 717f4b7..5287a09 100644 --- a/src/Sales/CreditmemoFixture.php +++ b/src/Sales/CreditmemoFixture.php @@ -17,7 +17,7 @@ public function __construct(CreditmemoInterface $creditmemo) $this->creditmemo = $creditmemo; } - public function getCreditmemo(): int + public function getCreditmemo(): CreditmemoInterface { return $this->creditmemo; } diff --git a/src/Sales/InvoiceFixture.php b/src/Sales/InvoiceFixture.php index ad2bac3..ac1d9c6 100644 --- a/src/Sales/InvoiceFixture.php +++ b/src/Sales/InvoiceFixture.php @@ -17,7 +17,7 @@ public function __construct(InvoiceInterface $shipment) $this->invoice = $shipment; } - public function getInvoice(): int + public function getInvoice(): InvoiceInterface { return $this->invoice; } diff --git a/src/Sales/OrderFixture.php b/src/Sales/OrderFixture.php index ca11293..cd5324d 100644 --- a/src/Sales/OrderFixture.php +++ b/src/Sales/OrderFixture.php @@ -17,7 +17,7 @@ public function __construct(Order $order) $this->order = $order; } - public function getOrder(): OrderInterface + public function getOrder(): Order { return $this->order; }