Skip to content

Commit

Permalink
fixed phpdoc errors
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Feb 14, 2018
1 parent 7f06085 commit cabad02
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 33 deletions.
3 changes: 1 addition & 2 deletions composer.json
Expand Up @@ -35,8 +35,7 @@
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
},
"entity-bundle-dir": "src/DandomainFoundation/"
}
},
"config": {
"sort-packages": true
Expand Down
@@ -1,10 +1,10 @@
<?php

namespace Loevgaard\DandomainStock\DandomainFoundation\Entity;
namespace Loevgaard\DandomainStock\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Loevgaard\DandomainStock\Entity\StockMovement;
use Loevgaard\DandomainStock\Entity\Generated\StockMovementInterface;
use Loevgaard\DandomainStock\Exception\StockMovementProductMismatchException;

trait OrderLineTrait
Expand All @@ -17,13 +17,13 @@ trait OrderLineTrait
protected $stockMovements;

/**
* @param \Loevgaard\DandomainStock\Entity\StockMovement $stockMovement
* @param \Loevgaard\DandomainStock\Entity\Generated\StockMovementInterface $stockMovement
*
* @return OrderLineTrait
*
* @throws \Loevgaard\DandomainStock\Exception\StockMovementProductMismatchException
*/
public function addStockMovement(StockMovement $stockMovement)
public function addStockMovement(StockMovementInterface $stockMovement)
{
$this->initStockMovements();

Expand Down Expand Up @@ -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);
Expand All @@ -86,20 +86,20 @@ 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();

if (!$this->stockMovements->count()) {
return null;
}

/** @var StockMovement $lastStockMovement */
/** @var StockMovementInterface $lastStockMovement */
$lastStockMovement = $this->stockMovements->last();

$qty = 0;
Expand Down
44 changes: 22 additions & 22 deletions src/Entity/StockMovement.php
Expand Up @@ -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
{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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
{
Expand All @@ -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
{
Expand All @@ -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
{
Expand Down Expand Up @@ -560,7 +560,7 @@ public function getCurrency(): string
/**
* @return Money
*
* @throws UnsetCurrencyException
* @throws \Loevgaard\DandomainStock\Exception\UnsetCurrencyException
*/
public function getRetailPrice(): Money
{
Expand All @@ -572,7 +572,7 @@ public function getRetailPrice(): Money
*
* @return $this
*
* @throws CurrencyMismatchException
* @throws \Loevgaard\DandomainStock\Exception\CurrencyMismatchException
*/
public function setRetailPrice(Money $retailPrice): self
{
Expand All @@ -586,7 +586,7 @@ public function setRetailPrice(Money $retailPrice): self
/**
* @return Money
*
* @throws UnsetCurrencyException
* @throws \Loevgaard\DandomainStock\Exception\UnsetCurrencyException
*/
public function getTotalRetailPrice(): Money
{
Expand All @@ -596,7 +596,7 @@ public function getTotalRetailPrice(): Money
/**
* @return Money
*
* @throws UnsetCurrencyException
* @throws \Loevgaard\DandomainStock\Exception\UnsetCurrencyException
*/
public function getPrice(): Money
{
Expand All @@ -608,7 +608,7 @@ public function getPrice(): Money
*
* @return $this
*
* @throws CurrencyMismatchException
* @throws \Loevgaard\DandomainStock\Exception\CurrencyMismatchException
*/
public function setPrice(Money $price): self
{
Expand All @@ -622,7 +622,7 @@ public function setPrice(Money $price): self
/**
* @return Money
*
* @throws UnsetCurrencyException
* @throws \Loevgaard\DandomainStock\Exception\UnsetCurrencyException
*/
public function getTotalPrice(): Money
{
Expand All @@ -632,7 +632,7 @@ public function getTotalPrice(): Money
/**
* @return Money
*
* @throws UnsetCurrencyException
* @throws \Loevgaard\DandomainStock\Exception\UnsetCurrencyException
*/
public function getDiscount(): Money
{
Expand All @@ -642,7 +642,7 @@ public function getDiscount(): Money
/**
* @return Money
*
* @throws UnsetCurrencyException
* @throws \Loevgaard\DandomainStock\Exception\UnsetCurrencyException
*/
public function getTotalDiscount(): Money
{
Expand Down Expand Up @@ -788,7 +788,7 @@ protected function updateDiscount(): void
*
* @return StockMovement
*
* @throws CurrencyMismatchException
* @throws \Loevgaard\DandomainStock\Exception\CurrencyMismatchException
*/
protected function updateCurrency(Money $money): self
{
Expand All @@ -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
{
Expand Down

0 comments on commit cabad02

Please sign in to comment.