Use typed properties

This commit is contained in:
Jan Böhmer 2022-09-18 22:59:31 +02:00
parent 548ec2ea50
commit 51e05a8669
216 changed files with 603 additions and 698 deletions

View file

@ -71,14 +71,14 @@ class Currency extends AbstractStructuralDBElement
* @ORM\Column(type="big_decimal", precision=11, scale=5, nullable=true)
* @BigDecimalPositive()
*/
protected $exchange_rate;
protected ?BigDecimal $exchange_rate = null;
/**
* @var string the 3 letter ISO code of the currency
* @ORM\Column(type="string")
* @Assert\Currency()
*/
protected $iso_code;
protected string $iso_code;
/**
* @ORM\OneToMany(targetEntity="Currency", mappedBy="parent", cascade={"persist"})

View file

@ -86,20 +86,20 @@ class Orderdetail extends AbstractDBElement implements TimeStampableInterface, N
* @var string
* @ORM\Column(type="string")
*/
protected $supplierpartnr = '';
protected string $supplierpartnr = '';
/**
* @var bool
* @ORM\Column(type="boolean")
*/
protected $obsolete = false;
protected bool $obsolete = false;
/**
* @var string
* @ORM\Column(type="string")
* @Assert\Url()
*/
protected $supplier_product_url = '';
protected string $supplier_product_url = '';
/**
* @var Part
@ -107,7 +107,7 @@ class Orderdetail extends AbstractDBElement implements TimeStampableInterface, N
* @ORM\JoinColumn(name="part_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")
* @Assert\NotNull()
*/
protected $part;
protected ?Part $part = null;
/**
* @var Supplier
@ -115,7 +115,7 @@ class Orderdetail extends AbstractDBElement implements TimeStampableInterface, N
* @ORM\JoinColumn(name="id_supplier", referencedColumnName="id")
* @Assert\NotNull(message="validator.orderdetail.supplier_must_not_be_null")
*/
protected $supplier;
protected ?Supplier $supplier = null;
public function __construct()
{

View file

@ -81,7 +81,7 @@ class Pricedetail extends AbstractDBElement implements TimeStampableInterface
* @ORM\Column(type="big_decimal", precision=11, scale=5)
* @BigDecimalPositive()
*/
protected $price;
protected BigDecimal $price;
/**
* @var ?Currency The currency used for the current price information.
@ -90,27 +90,27 @@ class Pricedetail extends AbstractDBElement implements TimeStampableInterface
* @ORM\JoinColumn(name="id_currency", referencedColumnName="id", nullable=true)
* @Selectable()
*/
protected $currency;
protected ?Currency $currency = null;
/**
* @var float
* @ORM\Column(type="float")
* @Assert\Positive()
*/
protected $price_related_quantity = 1.0;
protected float $price_related_quantity = 1.0;
/**
* @var float
* @ORM\Column(type="float")
* @Assert\Positive()
*/
protected $min_discount_quantity = 1.0;
protected float $min_discount_quantity = 1.0;
/**
* @var bool
* @ORM\Column(type="boolean")
*/
protected $manual_input = true;
protected bool $manual_input = true;
/**
* @var Orderdetail|null
@ -118,7 +118,7 @@ class Pricedetail extends AbstractDBElement implements TimeStampableInterface
* @ORM\JoinColumn(name="orderdetails_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")
* @Assert\NotNull()
*/
protected $orderdetail;
protected ?Orderdetail $orderdetail = null;
public function __construct()
{