forked from mirror/Part-DB.Part-DB-server
Fixed some issues detected by PHPstan.
This commit is contained in:
parent
f2ff77a8b3
commit
dd1f806c4e
30 changed files with 310 additions and 45 deletions
|
@ -37,7 +37,7 @@ abstract class AttachmentContainingDBElement extends NamedDBElement
|
|||
use MasterAttachmentTrait;
|
||||
|
||||
/**
|
||||
* @var Attachment[]
|
||||
* @var Attachment[]|Collection
|
||||
* //TODO
|
||||
* //@ORM\OneToMany(targetEntity="Attachment", mappedBy="element")
|
||||
*
|
||||
|
|
|
@ -54,7 +54,7 @@ class DatabaseUpdatedLogEntry extends AbstractLogEntry
|
|||
/**
|
||||
* Gets the database version before update.
|
||||
*
|
||||
* @return int
|
||||
* @return string
|
||||
*/
|
||||
public function getOldVersion(): string
|
||||
{
|
||||
|
@ -64,7 +64,7 @@ class DatabaseUpdatedLogEntry extends AbstractLogEntry
|
|||
/**
|
||||
* Gets the (target) database version after update.
|
||||
*
|
||||
* @return int
|
||||
* @return string
|
||||
*/
|
||||
public function getNewVersion(): string
|
||||
{
|
||||
|
|
|
@ -233,7 +233,7 @@ class PartLot extends DBElement
|
|||
/**
|
||||
* Sets the part that is stored in this part lot.
|
||||
*
|
||||
* @param Part|InstockTrait $part
|
||||
* @param Part $part
|
||||
*
|
||||
* @return PartLot
|
||||
*/
|
||||
|
|
|
@ -126,6 +126,7 @@ trait OrderTrait
|
|||
* The orderdetail is assigned to this part.
|
||||
*
|
||||
* @param Orderdetail $orderdetail the orderdetail that should be added
|
||||
* @return $this
|
||||
*/
|
||||
public function addOrderdetail(Orderdetail $orderdetail): self
|
||||
{
|
||||
|
@ -137,8 +138,8 @@ trait OrderTrait
|
|||
|
||||
/**
|
||||
* Removes the given orderdetail from the list of orderdetails.
|
||||
*
|
||||
* @return OrderTrait
|
||||
* @param Orderdetail $orderdetail
|
||||
* @return $this
|
||||
*/
|
||||
public function removeOrderdetail(Orderdetail $orderdetail): self
|
||||
{
|
||||
|
@ -158,6 +159,7 @@ trait OrderTrait
|
|||
* (if the part has exactly one orderdetails,
|
||||
* set this orderdetails as order orderdetails.
|
||||
* Otherwise, set "no order orderdetails")
|
||||
* @return $this
|
||||
*/
|
||||
public function setManualOrder(bool $new_manual_order, int $new_order_quantity = 1, ?Orderdetail $new_order_orderdetail = null): self
|
||||
{
|
||||
|
|
|
@ -245,7 +245,7 @@ class Orderdetail extends DBElement
|
|||
*
|
||||
* @return Pricedetail|null: the price as a bcmath string. Null if there are no orderdetails for the given quantity
|
||||
*/
|
||||
public function findPriceForQty(float $quantity = 1): ?Pricedetail
|
||||
public function findPriceForQty(float $quantity = 1.0): ?Pricedetail
|
||||
{
|
||||
if ($quantity <= 0) {
|
||||
return null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue