diff --git a/composer.json b/composer.json index a1e0ec2..e72fa92 100644 --- a/composer.json +++ b/composer.json @@ -35,8 +35,7 @@ "extra": { "branch-alias": { "dev-master": "1.0-dev" - }, - "entity-bundle-dir": "src/DandomainFoundation/" + } }, "config": { "sort-packages": true diff --git a/src/DandomainFoundation/Entity/OrderLineTrait.php b/src/Entity/OrderLineTrait.php similarity index 84% rename from src/DandomainFoundation/Entity/OrderLineTrait.php rename to src/Entity/OrderLineTrait.php index 4489033..b450086 100644 --- a/src/DandomainFoundation/Entity/OrderLineTrait.php +++ b/src/Entity/OrderLineTrait.php @@ -1,10 +1,10 @@ initStockMovements(); @@ -53,13 +53,13 @@ public function getStockMovements() } /** - * @param \Loevgaard\DandomainStock\Entity\StockMovement $stockMovements + * @param \Loevgaard\DandomainStock\Entity\Generated\StockMovementInterface[] $stockMovements * * @return OrderLineTrait * * @throws \Loevgaard\DandomainStock\Exception\StockMovementProductMismatchException */ - public function setStockMovements(StockMovement $stockMovements) + public function setStockMovements($stockMovements) { foreach ($stockMovements as $stockMovement) { $this->addStockMovement($stockMovement); @@ -86,12 +86,12 @@ public function setStockMovements(StockMovement $stockMovements) * * Returns null if the order line has 0 stock movements * - * @return \Loevgaard\DandomainStock\Entity\StockMovement|null + * @return \Loevgaard\DandomainStock\Entity\Generated\StockMovementInterface|null * * @throws \Loevgaard\DandomainStock\Exception\CurrencyMismatchException * @throws \Loevgaard\DandomainStock\Exception\UnsetCurrencyException */ - public function computeEffectiveStockMovement(): ?StockMovement + public function computeEffectiveStockMovement(): ?StockMovementInterface { $this->initStockMovements(); @@ -99,7 +99,7 @@ public function computeEffectiveStockMovement(): ?StockMovement return null; } - /** @var StockMovement $lastStockMovement */ + /** @var StockMovementInterface $lastStockMovement */ $lastStockMovement = $this->stockMovements->last(); $qty = 0; diff --git a/src/Entity/StockMovement.php b/src/Entity/StockMovement.php index 2b4f47e..1201a38 100644 --- a/src/Entity/StockMovement.php +++ b/src/Entity/StockMovement.php @@ -300,8 +300,8 @@ public function validate() * * @return StockMovementInterface * - * @throws CurrencyMismatchException - * @throws UndefinedPriceForCurrencyException + * @throws \Loevgaard\DandomainStock\Exception\CurrencyMismatchException + * @throws \Loevgaard\DandomainStock\Exception\UndefinedPriceForCurrencyException */ public static function create(int $quantity, Money $unitPrice, float $vatPercent, string $type, ProductInterface $product, string $reference): StockMovementInterface { @@ -334,9 +334,9 @@ public static function create(int $quantity, Money $unitPrice, float $vatPercent /** * @param OrderLineInterface $orderLine * - * @throws CurrencyMismatchException - * @throws UndefinedPriceForCurrencyException - * @throws UnsetProductException + * @throws \Loevgaard\DandomainStock\Exception\CurrencyMismatchException + * @throws \Loevgaard\DandomainStock\Exception\UndefinedPriceForCurrencyException + * @throws \Loevgaard\DandomainStock\Exception\UnsetProductException */ public function populateFromOrderLine(OrderLineInterface $orderLine) { @@ -375,8 +375,8 @@ public function populateFromOrderLine(OrderLineInterface $orderLine) /** * @return StockMovement * - * @throws CurrencyMismatchException - * @throws UnsetCurrencyException + * @throws \Loevgaard\DandomainStock\Exception\CurrencyMismatchException + * @throws \Loevgaard\DandomainStock\Exception\UnsetCurrencyException */ public function copy(): self { @@ -400,8 +400,8 @@ public function copy(): self /** * @return StockMovementInterface * - * @throws CurrencyMismatchException - * @throws UnsetCurrencyException + * @throws \Loevgaard\DandomainStock\Exception\CurrencyMismatchException + * @throws \Loevgaard\DandomainStock\Exception\UnsetCurrencyException */ public function inverse(): StockMovementInterface { @@ -414,9 +414,9 @@ public function inverse(): StockMovementInterface /** * @param StockMovementInterface $stockMovement * @return StockMovementInterface - * @throws CurrencyMismatchException - * @throws UnsetCurrencyException - * @throws StockMovementProductMismatchException + * @throws \Loevgaard\DandomainStock\Exception\CurrencyMismatchException + * @throws \Loevgaard\DandomainStock\Exception\UnsetCurrencyException + * @throws \Loevgaard\DandomainStock\Exception\StockMovementProductMismatchException */ public function diff(StockMovementInterface $stockMovement): StockMovementInterface { @@ -560,7 +560,7 @@ public function getCurrency(): string /** * @return Money * - * @throws UnsetCurrencyException + * @throws \Loevgaard\DandomainStock\Exception\UnsetCurrencyException */ public function getRetailPrice(): Money { @@ -572,7 +572,7 @@ public function getRetailPrice(): Money * * @return $this * - * @throws CurrencyMismatchException + * @throws \Loevgaard\DandomainStock\Exception\CurrencyMismatchException */ public function setRetailPrice(Money $retailPrice): self { @@ -586,7 +586,7 @@ public function setRetailPrice(Money $retailPrice): self /** * @return Money * - * @throws UnsetCurrencyException + * @throws \Loevgaard\DandomainStock\Exception\UnsetCurrencyException */ public function getTotalRetailPrice(): Money { @@ -596,7 +596,7 @@ public function getTotalRetailPrice(): Money /** * @return Money * - * @throws UnsetCurrencyException + * @throws \Loevgaard\DandomainStock\Exception\UnsetCurrencyException */ public function getPrice(): Money { @@ -608,7 +608,7 @@ public function getPrice(): Money * * @return $this * - * @throws CurrencyMismatchException + * @throws \Loevgaard\DandomainStock\Exception\CurrencyMismatchException */ public function setPrice(Money $price): self { @@ -622,7 +622,7 @@ public function setPrice(Money $price): self /** * @return Money * - * @throws UnsetCurrencyException + * @throws \Loevgaard\DandomainStock\Exception\UnsetCurrencyException */ public function getTotalPrice(): Money { @@ -632,7 +632,7 @@ public function getTotalPrice(): Money /** * @return Money * - * @throws UnsetCurrencyException + * @throws \Loevgaard\DandomainStock\Exception\UnsetCurrencyException */ public function getDiscount(): Money { @@ -642,7 +642,7 @@ public function getDiscount(): Money /** * @return Money * - * @throws UnsetCurrencyException + * @throws \Loevgaard\DandomainStock\Exception\UnsetCurrencyException */ public function getTotalDiscount(): Money { @@ -788,7 +788,7 @@ protected function updateDiscount(): void * * @return StockMovement * - * @throws CurrencyMismatchException + * @throws \Loevgaard\DandomainStock\Exception\CurrencyMismatchException */ protected function updateCurrency(Money $money): self { @@ -809,7 +809,7 @@ protected function updateCurrency(Money $money): self * * @return Money * - * @throws UnsetCurrencyException + * @throws \Loevgaard\DandomainStock\Exception\UnsetCurrencyException */ protected function money(int $val): Money {