From ea302ded91b3f82d282bb7c73d80c4a170771be2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 29 Mar 2020 15:59:00 +0200 Subject: [PATCH] Fixed PHPstan issues. --- src/Entity/Attachments/AttachmentType.php | 4 ++-- src/Entity/Devices/Device.php | 4 ++-- src/Entity/Parameters/ParametersTrait.php | 4 ++-- src/Entity/Parts/Category.php | 2 +- src/Entity/Parts/Footprint.php | 4 ++-- src/Entity/Parts/Manufacturer.php | 4 ++-- src/Entity/Parts/MeasurementUnit.php | 4 ++-- src/Entity/Parts/Part.php | 5 ++++- src/Entity/Parts/Storelocation.php | 4 ++-- src/Entity/Parts/Supplier.php | 5 +++-- src/Entity/PriceInformations/Currency.php | 4 ++-- src/Entity/UserSystem/Group.php | 4 ++-- 12 files changed, 26 insertions(+), 22 deletions(-) diff --git a/src/Entity/Attachments/AttachmentType.php b/src/Entity/Attachments/AttachmentType.php index 9971e547..6d0c4804 100644 --- a/src/Entity/Attachments/AttachmentType.php +++ b/src/Entity/Attachments/AttachmentType.php @@ -56,13 +56,13 @@ class AttachmentType extends AbstractStructuralDBElement */ protected $filetype_filter = ''; /** - * @var Collection|AttachmentTypeAttachment[] + * @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Attachments\AttachmentTypeAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @Assert\Valid() */ protected $attachments; - /** @var AttachmentTypeParameter[] + /** @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Parameters\AttachmentTypeParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @Assert\Valid() diff --git a/src/Entity/Devices/Device.php b/src/Entity/Devices/Device.php index d5c5bdae..45b2ef57 100644 --- a/src/Entity/Devices/Device.php +++ b/src/Entity/Devices/Device.php @@ -93,12 +93,12 @@ class Device extends AbstractPartsContainingDBElement */ protected $order_only_missing_parts = false; /** - * @var Collection|DeviceAttachment[] + * @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Attachments\DeviceAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) */ protected $attachments; - /** @var DeviceParameter[] + /** @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Parameters\DeviceParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) */ diff --git a/src/Entity/Parameters/ParametersTrait.php b/src/Entity/Parameters/ParametersTrait.php index 34d97a74..192dd842 100644 --- a/src/Entity/Parameters/ParametersTrait.php +++ b/src/Entity/Parameters/ParametersTrait.php @@ -31,7 +31,7 @@ trait ParametersTrait /** * Mapping done in subclasses. * - * @var AbstractParameter[]|Collection + * @var Collection * @Assert\Valid() */ protected $parameters; @@ -39,7 +39,7 @@ trait ParametersTrait /** * Return all associated specifications. * - * @return AbstractParameter[]|Collection + * @return Collection */ public function getParameters(): Collection { diff --git a/src/Entity/Parts/Category.php b/src/Entity/Parts/Category.php index 9c0a1a09..a2e903e2 100644 --- a/src/Entity/Parts/Category.php +++ b/src/Entity/Parts/Category.php @@ -107,7 +107,7 @@ class Category extends AbstractPartsContainingDBElement */ protected $attachments; - /** @var CategoryParameter[] + /** @var Collection|CategoryParameter[] * @ORM\OneToMany(targetEntity="App\Entity\Parameters\CategoryParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @Assert\Valid() diff --git a/src/Entity/Parts/Footprint.php b/src/Entity/Parts/Footprint.php index 666aa95f..1a32271a 100644 --- a/src/Entity/Parts/Footprint.php +++ b/src/Entity/Parts/Footprint.php @@ -81,7 +81,7 @@ class Footprint extends AbstractPartsContainingDBElement */ protected $parts; /** - * @var Collection|FootprintAttachment[] + * @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Attachments\FootprintAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @Assert\Valid() */ @@ -94,7 +94,7 @@ class Footprint extends AbstractPartsContainingDBElement */ protected $footprint_3d; - /** @var FootprintParameter[] + /** @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Parameters\FootprintParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})@ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @Assert\Valid() diff --git a/src/Entity/Parts/Manufacturer.php b/src/Entity/Parts/Manufacturer.php index e61e3063..6d72b3e4 100644 --- a/src/Entity/Parts/Manufacturer.php +++ b/src/Entity/Parts/Manufacturer.php @@ -81,13 +81,13 @@ class Manufacturer extends AbstractCompany */ protected $parts; /** - * @var Collection|ManufacturerAttachment[] + * @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Attachments\ManufacturerAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @Assert\Valid() */ protected $attachments; - /** @var ManufacturerParameter[] + /** @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Parameters\ManufacturerParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @Assert\Valid() diff --git a/src/Entity/Parts/MeasurementUnit.php b/src/Entity/Parts/MeasurementUnit.php index 78a4180d..295b04ca 100644 --- a/src/Entity/Parts/MeasurementUnit.php +++ b/src/Entity/Parts/MeasurementUnit.php @@ -98,13 +98,13 @@ class MeasurementUnit extends AbstractPartsContainingDBElement */ protected $parts; /** - * @var Collection|MeasurementUnitAttachment[] + * @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Attachments\MeasurementUnitAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @Assert\Valid() */ protected $attachments; - /** @var MeasurementUnitParameter[] + /** @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Parameters\MeasurementUnitParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @Assert\Valid() diff --git a/src/Entity/Parts/Part.php b/src/Entity/Parts/Part.php index 749c8af2..9f0b3511 100644 --- a/src/Entity/Parts/Part.php +++ b/src/Entity/Parts/Part.php @@ -52,6 +52,7 @@ namespace App\Entity\Parts; use App\Entity\Attachments\Attachment; use App\Entity\Attachments\AttachmentContainingDBElement; +use App\Entity\Attachments\PartAttachment; use App\Entity\Devices\Device; use App\Entity\Parameters\ParametersTrait; use App\Entity\Parameters\PartParameter; @@ -63,6 +64,7 @@ use App\Entity\Parts\PartTraits\OrderTrait; use App\Security\Annotations\ColumnSecurity; use DateTime; use Doctrine\Common\Collections\ArrayCollection; +use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; @@ -90,7 +92,7 @@ class Part extends AttachmentContainingDBElement */ protected $devices = []; - /** @var PartParameter[] + /** @var Collection * @Assert\Valid() * @ORM\OneToMany(targetEntity="App\Entity\Parameters\PartParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) @@ -117,6 +119,7 @@ class Part extends AttachmentContainingDBElement protected $name = ''; /** + * @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Attachments\PartAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ColumnSecurity(type="collection", prefix="attachments") * @Assert\Valid() diff --git a/src/Entity/Parts/Storelocation.php b/src/Entity/Parts/Storelocation.php index 3af60cbd..c0a69768 100644 --- a/src/Entity/Parts/Storelocation.php +++ b/src/Entity/Parts/Storelocation.php @@ -92,7 +92,7 @@ class Storelocation extends AbstractPartsContainingDBElement */ protected $parts; - /** @var StorelocationParameter[] + /** @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Parameters\StorelocationParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @Assert\Valid() @@ -117,7 +117,7 @@ class Storelocation extends AbstractPartsContainingDBElement */ protected $limit_to_existing_parts = false; /** - * @var Collection|StorelocationAttachment[] + * @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Attachments\StorelocationAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @Assert\Valid() */ diff --git a/src/Entity/Parts/Supplier.php b/src/Entity/Parts/Supplier.php index 0c35d768..cf1bd3c4 100644 --- a/src/Entity/Parts/Supplier.php +++ b/src/Entity/Parts/Supplier.php @@ -107,14 +107,15 @@ class Supplier extends AbstractCompany * ) */ protected $parts; + /** - * @var Collection|SupplierAttachment[] + * @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Attachments\SupplierAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @Assert\Valid() */ protected $attachments; - /** @var SupplierParameter[] + /** @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Parameters\SupplierParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @Assert\Valid() diff --git a/src/Entity/PriceInformations/Currency.php b/src/Entity/PriceInformations/Currency.php index 3a985ce1..0456c214 100644 --- a/src/Entity/PriceInformations/Currency.php +++ b/src/Entity/PriceInformations/Currency.php @@ -88,13 +88,13 @@ class Currency extends AbstractStructuralDBElement protected $parent; /** - * @var Collection|CurrencyAttachment[] + * @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Attachments\CurrencyAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @Assert\Valid() */ protected $attachments; - /** @var CurrencyParameter[] + /** @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Parameters\CurrencyParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @Assert\Valid() diff --git a/src/Entity/UserSystem/Group.php b/src/Entity/UserSystem/Group.php index 8ef9ec2a..21de2bd7 100644 --- a/src/Entity/UserSystem/Group.php +++ b/src/Entity/UserSystem/Group.php @@ -81,7 +81,7 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa */ protected $enforce2FA = false; /** - * @var Collection|GroupAttachment[] + * @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Attachments\ManufacturerAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @Assert\Valid() */ @@ -93,7 +93,7 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa */ protected $permissions; - /** @var GroupParameter[] + /** @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Parameters\GroupParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @Assert\Valid()