Fixed PHPstan issues.

This commit is contained in:
Jan Böhmer 2020-03-29 15:59:00 +02:00
parent 93aeeb162d
commit ea302ded91
12 changed files with 26 additions and 22 deletions

View file

@ -56,13 +56,13 @@ class AttachmentType extends AbstractStructuralDBElement
*/ */
protected $filetype_filter = ''; protected $filetype_filter = '';
/** /**
* @var Collection|AttachmentTypeAttachment[] * @var Collection<AttachmentTypeAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\AttachmentTypeAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="App\Entity\Attachments\AttachmentTypeAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @Assert\Valid() * @Assert\Valid()
*/ */
protected $attachments; protected $attachments;
/** @var AttachmentTypeParameter[] /** @var Collection<AttachmentTypeParameter>
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\AttachmentTypeParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="App\Entity\Parameters\AttachmentTypeParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
* @Assert\Valid() * @Assert\Valid()

View file

@ -93,12 +93,12 @@ class Device extends AbstractPartsContainingDBElement
*/ */
protected $order_only_missing_parts = false; protected $order_only_missing_parts = false;
/** /**
* @var Collection|DeviceAttachment[] * @var Collection<DeviceAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\DeviceAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="App\Entity\Attachments\DeviceAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
*/ */
protected $attachments; protected $attachments;
/** @var DeviceParameter[] /** @var Collection<DeviceParameter>
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\DeviceParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="App\Entity\Parameters\DeviceParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
*/ */

View file

@ -31,7 +31,7 @@ trait ParametersTrait
/** /**
* Mapping done in subclasses. * Mapping done in subclasses.
* *
* @var AbstractParameter[]|Collection * @var Collection<AbstractParameter>
* @Assert\Valid() * @Assert\Valid()
*/ */
protected $parameters; protected $parameters;
@ -39,7 +39,7 @@ trait ParametersTrait
/** /**
* Return all associated specifications. * Return all associated specifications.
* *
* @return AbstractParameter[]|Collection * @return Collection<AbstractParameter>
*/ */
public function getParameters(): Collection public function getParameters(): Collection
{ {

View file

@ -107,7 +107,7 @@ class Category extends AbstractPartsContainingDBElement
*/ */
protected $attachments; protected $attachments;
/** @var CategoryParameter[] /** @var Collection|CategoryParameter[]
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\CategoryParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="App\Entity\Parameters\CategoryParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
* @Assert\Valid() * @Assert\Valid()

View file

@ -81,7 +81,7 @@ class Footprint extends AbstractPartsContainingDBElement
*/ */
protected $parts; protected $parts;
/** /**
* @var Collection|FootprintAttachment[] * @var Collection<FootprintAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\FootprintAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="App\Entity\Attachments\FootprintAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @Assert\Valid() * @Assert\Valid()
*/ */
@ -94,7 +94,7 @@ class Footprint extends AbstractPartsContainingDBElement
*/ */
protected $footprint_3d; protected $footprint_3d;
/** @var FootprintParameter[] /** @var Collection<FootprintParameter>
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\FootprintParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @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"}) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})@ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
* @Assert\Valid() * @Assert\Valid()

View file

@ -81,13 +81,13 @@ class Manufacturer extends AbstractCompany
*/ */
protected $parts; protected $parts;
/** /**
* @var Collection|ManufacturerAttachment[] * @var Collection<ManufacturerAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\ManufacturerAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="App\Entity\Attachments\ManufacturerAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @Assert\Valid() * @Assert\Valid()
*/ */
protected $attachments; protected $attachments;
/** @var ManufacturerParameter[] /** @var Collection<ManufacturerParameter>
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\ManufacturerParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="App\Entity\Parameters\ManufacturerParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
* @Assert\Valid() * @Assert\Valid()

View file

@ -98,13 +98,13 @@ class MeasurementUnit extends AbstractPartsContainingDBElement
*/ */
protected $parts; protected $parts;
/** /**
* @var Collection|MeasurementUnitAttachment[] * @var Collection<MeasurementUnitAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\MeasurementUnitAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="App\Entity\Attachments\MeasurementUnitAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @Assert\Valid() * @Assert\Valid()
*/ */
protected $attachments; protected $attachments;
/** @var MeasurementUnitParameter[] /** @var Collection<MeasurementUnitParameter>
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\MeasurementUnitParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="App\Entity\Parameters\MeasurementUnitParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
* @Assert\Valid() * @Assert\Valid()

View file

@ -52,6 +52,7 @@ namespace App\Entity\Parts;
use App\Entity\Attachments\Attachment; use App\Entity\Attachments\Attachment;
use App\Entity\Attachments\AttachmentContainingDBElement; use App\Entity\Attachments\AttachmentContainingDBElement;
use App\Entity\Attachments\PartAttachment;
use App\Entity\Devices\Device; use App\Entity\Devices\Device;
use App\Entity\Parameters\ParametersTrait; use App\Entity\Parameters\ParametersTrait;
use App\Entity\Parameters\PartParameter; use App\Entity\Parameters\PartParameter;
@ -63,6 +64,7 @@ use App\Entity\Parts\PartTraits\OrderTrait;
use App\Security\Annotations\ColumnSecurity; use App\Security\Annotations\ColumnSecurity;
use DateTime; use DateTime;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Constraints as Assert;
@ -90,7 +92,7 @@ class Part extends AttachmentContainingDBElement
*/ */
protected $devices = []; protected $devices = [];
/** @var PartParameter[] /** @var Collection<PartParameter>
* @Assert\Valid() * @Assert\Valid()
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\PartParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="App\Entity\Parameters\PartParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
@ -117,6 +119,7 @@ class Part extends AttachmentContainingDBElement
protected $name = ''; protected $name = '';
/** /**
* @var Collection<PartAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\PartAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="App\Entity\Attachments\PartAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ColumnSecurity(type="collection", prefix="attachments") * @ColumnSecurity(type="collection", prefix="attachments")
* @Assert\Valid() * @Assert\Valid()

View file

@ -92,7 +92,7 @@ class Storelocation extends AbstractPartsContainingDBElement
*/ */
protected $parts; protected $parts;
/** @var StorelocationParameter[] /** @var Collection<StorelocationParameter>
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\StorelocationParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="App\Entity\Parameters\StorelocationParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
* @Assert\Valid() * @Assert\Valid()
@ -117,7 +117,7 @@ class Storelocation extends AbstractPartsContainingDBElement
*/ */
protected $limit_to_existing_parts = false; protected $limit_to_existing_parts = false;
/** /**
* @var Collection|StorelocationAttachment[] * @var Collection<StorelocationAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\StorelocationAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="App\Entity\Attachments\StorelocationAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @Assert\Valid() * @Assert\Valid()
*/ */

View file

@ -107,14 +107,15 @@ class Supplier extends AbstractCompany
* ) * )
*/ */
protected $parts; protected $parts;
/** /**
* @var Collection|SupplierAttachment[] * @var Collection<SupplierAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\SupplierAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="App\Entity\Attachments\SupplierAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @Assert\Valid() * @Assert\Valid()
*/ */
protected $attachments; protected $attachments;
/** @var SupplierParameter[] /** @var Collection<SupplierParameter>
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\SupplierParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="App\Entity\Parameters\SupplierParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
* @Assert\Valid() * @Assert\Valid()

View file

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

View file

@ -81,7 +81,7 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa
*/ */
protected $enforce2FA = false; protected $enforce2FA = false;
/** /**
* @var Collection|GroupAttachment[] * @var Collection<GroupAttachment>
* @ORM\OneToMany(targetEntity="App\Entity\Attachments\ManufacturerAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="App\Entity\Attachments\ManufacturerAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @Assert\Valid() * @Assert\Valid()
*/ */
@ -93,7 +93,7 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa
*/ */
protected $permissions; protected $permissions;
/** @var GroupParameter[] /** @var Collection<GroupParameter>
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\GroupParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OneToMany(targetEntity="App\Entity\Parameters\GroupParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
* @Assert\Valid() * @Assert\Valid()