Fixed some psalm issues.

This commit is contained in:
Jan Böhmer 2020-03-29 23:13:25 +02:00
parent eb9b24d5d7
commit cb0aa7bc7a
32 changed files with 217 additions and 148 deletions

View file

@ -88,13 +88,13 @@ class Currency extends AbstractStructuralDBElement
protected $parent;
/**
* @var Collection<CurrencyAttachment>
* @var Collection<int, CurrencyAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\CurrencyAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @Assert\Valid()
*/
protected $attachments;
/** @var Collection<CurrencyParameter>
/** @var Collection<int, CurrencyParameter>
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\CurrencyParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
* @Assert\Valid()

View file

@ -136,11 +136,11 @@ class Pricedetail extends AbstractDBElement implements TimeStampableInterface
*********************************************************************************/
/**
* Get the orderdetail to which this pricedetail belongs to this pricedetails.
* Get the orderdetail to which this pricedetail belongs to this pricedetails.
*
* @return Orderdetail the orderdetail this price belongs to
* @return Orderdetail|null the orderdetail this price belongs to
*/
public function getOrderdetail(): Orderdetail
public function getOrderdetail(): ?Orderdetail
{
return $this->orderdetail;
}
@ -157,17 +157,20 @@ class Pricedetail extends AbstractDBElement implements TimeStampableInterface
}
/**
* Get the price for a single unit in the currency associated with this price detail.
* Get the price for a single unit in the currency associated with this price detail.
*
* @param float|string $multiplier The returned price (float or string) will be multiplied
* with this multiplier.
*
* You will get the price for $multiplier parts. If you want the price which is stored
* in the database, you have to pass the "price_related_quantity" count as $multiplier.
*
* @param float|string $multiplier The returned price (float or string) will be multiplied
* with this multiplier.
*
* You will get the price for $multiplier parts. If you want the price which is stored
* in the database, you have to pass the "price_related_quantity" count as $multiplier.
*
* @return string the price as a bcmath string
* @return null|string the price as a bcmath string
*/
public function getPricePerUnit($multiplier = 1.0): string
public function getPricePerUnit($multiplier = 1.0): ?string
{
$multiplier = (string) $multiplier;
$tmp = bcmul($this->price, $multiplier, static::PRICE_PRECISION);