Fixed some PHPStan level 5 issues

This commit is contained in:
Jan Böhmer 2023-06-13 20:24:54 +02:00
parent 74051c5649
commit 19530a9102
35 changed files with 95 additions and 63 deletions

View file

@ -66,7 +66,7 @@ trait BasicPropertyTrait
#[Assert\NotNull(message: 'validator.select_valid_category')]
#[Selectable()]
#[Groups(['simple', 'extended', 'full', 'import'])]
#[ORM\ManyToOne(targetEntity: 'Category')]
#[ORM\ManyToOne(targetEntity: Category::class)]
#[ORM\JoinColumn(name: 'id_category', nullable: false)]
protected ?Category $category = null;
@ -74,7 +74,7 @@ trait BasicPropertyTrait
* @var Footprint|null The footprint of this part (e.g. DIP8)
*/
#[Groups(['simple', 'extended', 'full', 'import'])]
#[ORM\ManyToOne(targetEntity: 'Footprint')]
#[ORM\ManyToOne(targetEntity: Footprint::class)]
#[ORM\JoinColumn(name: 'id_footprint')]
#[Selectable()]
protected ?Footprint $footprint = null;

View file

@ -40,7 +40,7 @@ trait InstockTrait
*/
#[Assert\Valid]
#[Groups(['extended', 'full', 'import'])]
#[ORM\OneToMany(targetEntity: 'PartLot', mappedBy: 'part', cascade: ['persist', 'remove'], orphanRemoval: true)]
#[ORM\OneToMany(targetEntity: PartLot::class, mappedBy: 'part', cascade: ['persist', 'remove'], orphanRemoval: true)]
#[ORM\OrderBy(['amount' => 'DESC'])]
protected Collection $partLots;
@ -57,7 +57,7 @@ trait InstockTrait
* @var ?MeasurementUnit the unit in which the part's amount is measured
*/
#[Groups(['extended', 'full', 'import'])]
#[ORM\ManyToOne(targetEntity: 'MeasurementUnit')]
#[ORM\ManyToOne(targetEntity: MeasurementUnit::class)]
#[ORM\JoinColumn(name: 'id_part_unit')]
protected ?MeasurementUnit $partUnit = null;

View file

@ -39,7 +39,7 @@ trait ManufacturerTrait
* @var Manufacturer|null The manufacturer of this part
*/
#[Groups(['simple', 'extended', 'full', 'import'])]
#[ORM\ManyToOne(targetEntity: 'Manufacturer')]
#[ORM\ManyToOne(targetEntity: Manufacturer::class)]
#[ORM\JoinColumn(name: 'id_manufacturer')]
#[Selectable()]
protected ?Manufacturer $manufacturer = null;

View file

@ -98,7 +98,7 @@ trait OrderTrait
*
* @param bool $hide_obsolete If true, obsolete orderdetails will NOT be returned
*
* @return Collection|Orderdetail[] * all orderdetails as a one-dimensional array of Orderdetails objects
* @return Collection<int, Orderdetail> * all orderdetails as a one-dimensional array of Orderdetails objects
* (empty array if there are no ones)
* * the array is sorted by the suppliers names / minimum order quantity
*/