diff --git a/src/Entity/Attachments/AttachmentContainingDBElement.php b/src/Entity/Attachments/AttachmentContainingDBElement.php index b550394e..e74d7cb6 100644 --- a/src/Entity/Attachments/AttachmentContainingDBElement.php +++ b/src/Entity/Attachments/AttachmentContainingDBElement.php @@ -46,7 +46,7 @@ abstract class AttachmentContainingDBElement extends AbstractNamedDBElement impl * Mapping is done in sub classes like part * @Groups({"full"}) */ - protected $attachments; + protected Collection $attachments; public function __construct() { diff --git a/src/Entity/Attachments/AttachmentType.php b/src/Entity/Attachments/AttachmentType.php index 33ed8b18..de67e8d9 100644 --- a/src/Entity/Attachments/AttachmentType.php +++ b/src/Entity/Attachments/AttachmentType.php @@ -45,7 +45,7 @@ class AttachmentType extends AbstractStructuralDBElement * @ORM\OneToMany(targetEntity="AttachmentType", mappedBy="parent", cascade={"persist"}) * @ORM\OrderBy({"name" = "ASC"}) */ - protected $children; + protected Collection $children; /** * @ORM\ManyToOne(targetEntity="AttachmentType", inversedBy="children") @@ -65,14 +65,14 @@ class AttachmentType extends AbstractStructuralDBElement * @ORM\OrderBy({"name" = "ASC"}) * @Assert\Valid() */ - protected $attachments; + protected Collection $attachments; /** @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Parameters\AttachmentTypeParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @Assert\Valid() */ - protected $parameters; + protected Collection $parameters; /** * @var Collection diff --git a/src/Entity/Base/AbstractPartsContainingDBElement.php b/src/Entity/Base/AbstractPartsContainingDBElement.php index be0b230a..52326907 100644 --- a/src/Entity/Base/AbstractPartsContainingDBElement.php +++ b/src/Entity/Base/AbstractPartsContainingDBElement.php @@ -22,6 +22,7 @@ declare(strict_types=1); namespace App\Entity\Base; +use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Annotation\Groups; @@ -33,5 +34,5 @@ use Symfony\Component\Serializer\Annotation\Groups; abstract class AbstractPartsContainingDBElement extends AbstractStructuralDBElement { /** @Groups({"full"}) */ - protected $parameters; + protected Collection $parameters; } diff --git a/src/Entity/Base/AbstractStructuralDBElement.php b/src/Entity/Base/AbstractStructuralDBElement.php index eec1a73e..2ac874ca 100644 --- a/src/Entity/Base/AbstractStructuralDBElement.php +++ b/src/Entity/Base/AbstractStructuralDBElement.php @@ -87,7 +87,7 @@ abstract class AbstractStructuralDBElement extends AttachmentContainingDBElement * @var AbstractStructuralDBElement[]|Collection * @Groups({"include_children"}) */ - protected $children; + protected Collection $children; /** * @var AbstractStructuralDBElement @@ -106,6 +106,7 @@ abstract class AbstractStructuralDBElement extends AttachmentContainingDBElement parent::__construct(); $this->children = new ArrayCollection(); $this->parameters = new ArrayCollection(); + $this->parent = null; } public function __clone() diff --git a/src/Entity/LabelSystem/LabelProfile.php b/src/Entity/LabelSystem/LabelProfile.php index 46c478ee..12f6d659 100644 --- a/src/Entity/LabelSystem/LabelProfile.php +++ b/src/Entity/LabelSystem/LabelProfile.php @@ -61,7 +61,7 @@ class LabelProfile extends AttachmentContainingDBElement * @ORM\OneToMany(targetEntity="App\Entity\Attachments\LabelAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OrderBy({"name" = "ASC"}) */ - protected $attachments; + protected Collection $attachments; /** * @var LabelOptions diff --git a/src/Entity/Parameters/AbstractParameter.php b/src/Entity/Parameters/AbstractParameter.php index 08e4d7b7..922bb43e 100644 --- a/src/Entity/Parameters/AbstractParameter.php +++ b/src/Entity/Parameters/AbstractParameter.php @@ -143,7 +143,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement * * @var AbstractDBElement|null the element to which this parameter belongs to */ - protected ?AbstractDBElement $element; + protected ?AbstractDBElement $element = null; public function __construct() { diff --git a/src/Entity/Parameters/AttachmentTypeParameter.php b/src/Entity/Parameters/AttachmentTypeParameter.php index 89fdbbc3..8a161883 100644 --- a/src/Entity/Parameters/AttachmentTypeParameter.php +++ b/src/Entity/Parameters/AttachmentTypeParameter.php @@ -42,6 +42,7 @@ declare(strict_types=1); namespace App\Entity\Parameters; use App\Entity\Attachments\AttachmentType; +use App\Entity\Base\AbstractDBElement; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; @@ -57,5 +58,5 @@ class AttachmentTypeParameter extends AbstractParameter * @ORM\ManyToOne(targetEntity="App\Entity\Attachments\AttachmentType", inversedBy="parameters") * @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). */ - protected ?\App\Entity\Base\AbstractDBElement $element; + protected ?AbstractDBElement $element = null; } diff --git a/src/Entity/Parameters/CategoryParameter.php b/src/Entity/Parameters/CategoryParameter.php index f5989823..cce90a86 100644 --- a/src/Entity/Parameters/CategoryParameter.php +++ b/src/Entity/Parameters/CategoryParameter.php @@ -41,6 +41,7 @@ declare(strict_types=1); namespace App\Entity\Parameters; +use App\Entity\Base\AbstractDBElement; use App\Entity\Parts\Category; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; @@ -57,5 +58,5 @@ class CategoryParameter extends AbstractParameter * @ORM\ManyToOne(targetEntity="App\Entity\Parts\Category", inversedBy="parameters") * @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). */ - protected ?\App\Entity\Base\AbstractDBElement $element; + protected ?AbstractDBElement $element = null; } diff --git a/src/Entity/Parameters/CurrencyParameter.php b/src/Entity/Parameters/CurrencyParameter.php index 4afdedbe..9f99310e 100644 --- a/src/Entity/Parameters/CurrencyParameter.php +++ b/src/Entity/Parameters/CurrencyParameter.php @@ -41,6 +41,7 @@ declare(strict_types=1); namespace App\Entity\Parameters; +use App\Entity\Base\AbstractDBElement; use App\Entity\PriceInformations\Currency; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; @@ -60,5 +61,5 @@ class CurrencyParameter extends AbstractParameter * @ORM\ManyToOne(targetEntity="App\Entity\PriceInformations\Currency", inversedBy="parameters") * @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). */ - protected ?\App\Entity\Base\AbstractDBElement $element; + protected ?AbstractDBElement $element = null; } diff --git a/src/Entity/Parameters/FootprintParameter.php b/src/Entity/Parameters/FootprintParameter.php index aa6f803c..cb1dd185 100644 --- a/src/Entity/Parameters/FootprintParameter.php +++ b/src/Entity/Parameters/FootprintParameter.php @@ -41,6 +41,7 @@ declare(strict_types=1); namespace App\Entity\Parameters; +use App\Entity\Base\AbstractDBElement; use App\Entity\Parts\Footprint; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; @@ -58,5 +59,5 @@ class FootprintParameter extends AbstractParameter * @ORM\ManyToOne(targetEntity="App\Entity\Parts\Footprint", inversedBy="parameters") * @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). */ - protected ?\App\Entity\Base\AbstractDBElement $element; + protected ?AbstractDBElement $element = null; } diff --git a/src/Entity/Parameters/GroupParameter.php b/src/Entity/Parameters/GroupParameter.php index 0d22ae62..81a0d39c 100644 --- a/src/Entity/Parameters/GroupParameter.php +++ b/src/Entity/Parameters/GroupParameter.php @@ -41,6 +41,7 @@ declare(strict_types=1); namespace App\Entity\Parameters; +use App\Entity\Base\AbstractDBElement; use App\Entity\UserSystem\Group; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; @@ -58,5 +59,5 @@ class GroupParameter extends AbstractParameter * @ORM\ManyToOne(targetEntity="App\Entity\UserSystem\Group", inversedBy="parameters") * @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). */ - protected ?\App\Entity\Base\AbstractDBElement $element; + protected ?AbstractDBElement $element = null; } diff --git a/src/Entity/Parameters/ManufacturerParameter.php b/src/Entity/Parameters/ManufacturerParameter.php index 547e3b80..56d785f2 100644 --- a/src/Entity/Parameters/ManufacturerParameter.php +++ b/src/Entity/Parameters/ManufacturerParameter.php @@ -41,6 +41,7 @@ declare(strict_types=1); namespace App\Entity\Parameters; +use App\Entity\Base\AbstractDBElement; use App\Entity\Parts\Manufacturer; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; @@ -58,5 +59,5 @@ class ManufacturerParameter extends AbstractParameter * @ORM\ManyToOne(targetEntity="App\Entity\Parts\Manufacturer", inversedBy="parameters") * @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). */ - protected ?\App\Entity\Base\AbstractDBElement $element; + protected ?AbstractDBElement $element = null; } diff --git a/src/Entity/Parameters/MeasurementUnitParameter.php b/src/Entity/Parameters/MeasurementUnitParameter.php index c95f8844..e4980431 100644 --- a/src/Entity/Parameters/MeasurementUnitParameter.php +++ b/src/Entity/Parameters/MeasurementUnitParameter.php @@ -41,6 +41,7 @@ declare(strict_types=1); namespace App\Entity\Parameters; +use App\Entity\Base\AbstractDBElement; use App\Entity\Parts\MeasurementUnit; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; @@ -58,5 +59,5 @@ class MeasurementUnitParameter extends AbstractParameter * @ORM\ManyToOne(targetEntity="App\Entity\Parts\MeasurementUnit", inversedBy="parameters") * @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). */ - protected ?\App\Entity\Base\AbstractDBElement $element; + protected ?AbstractDBElement $element = null; } diff --git a/src/Entity/Parameters/PartParameter.php b/src/Entity/Parameters/PartParameter.php index b5d0fbaa..a3845e55 100644 --- a/src/Entity/Parameters/PartParameter.php +++ b/src/Entity/Parameters/PartParameter.php @@ -41,6 +41,7 @@ declare(strict_types=1); namespace App\Entity\Parameters; +use App\Entity\Base\AbstractDBElement; use App\Entity\Parts\Part; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; @@ -58,5 +59,5 @@ class PartParameter extends AbstractParameter * @ORM\ManyToOne(targetEntity="App\Entity\Parts\Part", inversedBy="parameters") * @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). */ - protected ?\App\Entity\Base\AbstractDBElement $element; + protected ?AbstractDBElement $element = null; } diff --git a/src/Entity/Parameters/ProjectParameter.php b/src/Entity/Parameters/ProjectParameter.php index b4269e9c..d4f8cd1a 100644 --- a/src/Entity/Parameters/ProjectParameter.php +++ b/src/Entity/Parameters/ProjectParameter.php @@ -41,6 +41,7 @@ declare(strict_types=1); namespace App\Entity\Parameters; +use App\Entity\Base\AbstractDBElement; use App\Entity\ProjectSystem\Project; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; @@ -58,5 +59,5 @@ class ProjectParameter extends AbstractParameter * @ORM\ManyToOne(targetEntity="App\Entity\ProjectSystem\Project", inversedBy="parameters") * @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). */ - protected ?\App\Entity\Base\AbstractDBElement $element; + protected ?AbstractDBElement $element = null; } diff --git a/src/Entity/Parameters/StorelocationParameter.php b/src/Entity/Parameters/StorelocationParameter.php index b236ad1c..6c7d430b 100644 --- a/src/Entity/Parameters/StorelocationParameter.php +++ b/src/Entity/Parameters/StorelocationParameter.php @@ -41,6 +41,7 @@ declare(strict_types=1); namespace App\Entity\Parameters; +use App\Entity\Base\AbstractDBElement; use App\Entity\Parts\Storelocation; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; @@ -58,5 +59,5 @@ class StorelocationParameter extends AbstractParameter * @ORM\ManyToOne(targetEntity="App\Entity\Parts\Storelocation", inversedBy="parameters") * @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). */ - protected ?\App\Entity\Base\AbstractDBElement $element; + protected ?AbstractDBElement $element = null; } diff --git a/src/Entity/Parameters/SupplierParameter.php b/src/Entity/Parameters/SupplierParameter.php index 534cc949..6acac705 100644 --- a/src/Entity/Parameters/SupplierParameter.php +++ b/src/Entity/Parameters/SupplierParameter.php @@ -41,6 +41,7 @@ declare(strict_types=1); namespace App\Entity\Parameters; +use App\Entity\Base\AbstractDBElement; use App\Entity\Parts\Supplier; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; @@ -58,5 +59,5 @@ class SupplierParameter extends AbstractParameter * @ORM\ManyToOne(targetEntity="App\Entity\Parts\Supplier", inversedBy="parameters") * @ORM\JoinColumn(name="element_id", referencedColumnName="id", nullable=false, onDelete="CASCADE"). */ - protected ?\App\Entity\Base\AbstractDBElement $element; + protected ?AbstractDBElement $element = null; } diff --git a/src/Entity/Parts/Category.php b/src/Entity/Parts/Category.php index 7dd37c0f..8a79d871 100644 --- a/src/Entity/Parts/Category.php +++ b/src/Entity/Parts/Category.php @@ -24,6 +24,7 @@ namespace App\Entity\Parts; use App\Entity\Attachments\CategoryAttachment; use App\Entity\Base\AbstractPartsContainingDBElement; +use App\Entity\Base\AbstractStructuralDBElement; use App\Entity\Parameters\CategoryParameter; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; @@ -46,13 +47,13 @@ class Category extends AbstractPartsContainingDBElement * @ORM\OrderBy({"name" = "ASC"}) * @var Collection */ - protected $children; + protected Collection $children; /** * @ORM\ManyToOne(targetEntity="Category", inversedBy="children") * @ORM\JoinColumn(name="parent_id", referencedColumnName="id") */ - protected ?\App\Entity\Base\AbstractStructuralDBElement $parent; + protected ?AbstractStructuralDBElement $parent = null; /** * @var string @@ -109,6 +110,7 @@ class Category extends AbstractPartsContainingDBElement * @Groups({"full", "import"}) */ protected string $default_comment = ''; + /** * @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Attachments\CategoryAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) @@ -116,7 +118,7 @@ class Category extends AbstractPartsContainingDBElement * @Assert\Valid() * @Groups({"full"}) */ - protected $attachments; + protected Collection $attachments; /** @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Parameters\CategoryParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) @@ -124,7 +126,7 @@ class Category extends AbstractPartsContainingDBElement * @Assert\Valid() * @Groups({"full"}) */ - protected $parameters; + protected Collection $parameters; public function getPartnameHint(): string { diff --git a/src/Entity/Parts/Footprint.php b/src/Entity/Parts/Footprint.php index 079d1168..09a4f4d0 100644 --- a/src/Entity/Parts/Footprint.php +++ b/src/Entity/Parts/Footprint.php @@ -51,7 +51,7 @@ class Footprint extends AbstractPartsContainingDBElement * @ORM\OrderBy({"name" = "ASC"}) * @var Collection */ - protected $children; + protected Collection $children; /** * @var Collection @@ -59,7 +59,7 @@ class Footprint extends AbstractPartsContainingDBElement * @ORM\OrderBy({"name" = "ASC"}) * @Assert\Valid() */ - protected $attachments; + protected Collection $attachments; /** * @var FootprintAttachment|null @@ -73,7 +73,7 @@ class Footprint extends AbstractPartsContainingDBElement * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @Assert\Valid() */ - protected $parameters; + protected Collection $parameters; /**************************************** * Getters diff --git a/src/Entity/Parts/Manufacturer.php b/src/Entity/Parts/Manufacturer.php index 17ab8543..74d0e308 100644 --- a/src/Entity/Parts/Manufacturer.php +++ b/src/Entity/Parts/Manufacturer.php @@ -51,7 +51,7 @@ class Manufacturer extends AbstractCompany * @ORM\OrderBy({"name" = "ASC"}) * @var Collection */ - protected $children; + protected Collection $children; /** * @var Collection @@ -59,12 +59,12 @@ class Manufacturer extends AbstractCompany * @ORM\OrderBy({"name" = "ASC"}) * @Assert\Valid() */ - protected $attachments; + protected Collection $attachments; /** @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Parameters\ManufacturerParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @Assert\Valid() */ - protected $parameters; + protected Collection $parameters; } diff --git a/src/Entity/Parts/MeasurementUnit.php b/src/Entity/Parts/MeasurementUnit.php index 7ebdfc85..b33d47fc 100644 --- a/src/Entity/Parts/MeasurementUnit.php +++ b/src/Entity/Parts/MeasurementUnit.php @@ -75,7 +75,7 @@ class MeasurementUnit extends AbstractPartsContainingDBElement * @ORM\OrderBy({"name" = "ASC"}) * @var Collection */ - protected $children; + protected Collection $children; /** * @ORM\ManyToOne(targetEntity="MeasurementUnit", inversedBy="children") @@ -89,14 +89,14 @@ class MeasurementUnit extends AbstractPartsContainingDBElement * @ORM\OrderBy({"name" = "ASC"}) * @Assert\Valid() */ - protected $attachments; + protected Collection $attachments; /** @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Parameters\MeasurementUnitParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @Assert\Valid() */ - protected $parameters; + protected Collection $parameters; /** * @return string diff --git a/src/Entity/Parts/Part.php b/src/Entity/Parts/Part.php index 4cbdb7a0..d1179782 100644 --- a/src/Entity/Parts/Part.php +++ b/src/Entity/Parts/Part.php @@ -75,7 +75,7 @@ class Part extends AttachmentContainingDBElement * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @Groups({"full"}) */ - protected $parameters; + protected Collection $parameters; /** * @ORM\Column(type="datetime", name="datetime_added", options={"default":"CURRENT_TIMESTAMP"}) @@ -100,7 +100,7 @@ class Part extends AttachmentContainingDBElement * @Assert\Valid() * @Groups({"full"}) */ - protected $attachments; + protected Collection $attachments; /** * @var DateTime|null the date when this element was modified the last time diff --git a/src/Entity/Parts/Storelocation.php b/src/Entity/Parts/Storelocation.php index 58e2f2e8..03c5951f 100644 --- a/src/Entity/Parts/Storelocation.php +++ b/src/Entity/Parts/Storelocation.php @@ -24,6 +24,7 @@ namespace App\Entity\Parts; use App\Entity\Attachments\StorelocationAttachment; use App\Entity\Base\AbstractPartsContainingDBElement; +use App\Entity\Base\AbstractStructuralDBElement; use App\Entity\Parameters\StorelocationParameter; use App\Entity\UserSystem\User; use Doctrine\Common\Collections\Collection; @@ -47,13 +48,13 @@ class Storelocation extends AbstractPartsContainingDBElement * @ORM\OrderBy({"name" = "ASC"}) * @var Collection */ - protected $children; + protected Collection $children; /** * @ORM\ManyToOne(targetEntity="Storelocation", inversedBy="children") * @ORM\JoinColumn(name="parent_id", referencedColumnName="id") */ - protected ?\App\Entity\Base\AbstractStructuralDBElement $parent; + protected ?AbstractStructuralDBElement $parent; /** * @var MeasurementUnit|null The measurement unit, which parts can be stored in here @@ -67,7 +68,7 @@ class Storelocation extends AbstractPartsContainingDBElement * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @Assert\Valid() */ - protected $parameters; + protected Collection $parameters; /** * @var bool @@ -109,7 +110,7 @@ class Storelocation extends AbstractPartsContainingDBElement * @ORM\OneToMany(targetEntity="App\Entity\Attachments\StorelocationAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @Assert\Valid() */ - protected $attachments; + protected Collection $attachments; /******************************************************************************** * diff --git a/src/Entity/Parts/Supplier.php b/src/Entity/Parts/Supplier.php index e6068115..f8ab4202 100644 --- a/src/Entity/Parts/Supplier.php +++ b/src/Entity/Parts/Supplier.php @@ -24,6 +24,7 @@ namespace App\Entity\Parts; use App\Entity\Attachments\SupplierAttachment; use App\Entity\Base\AbstractCompany; +use App\Entity\Base\AbstractStructuralDBElement; use App\Entity\Parameters\SupplierParameter; use App\Entity\PriceInformations\Currency; use App\Validator\Constraints\BigDecimal\BigDecimalPositiveOrZero; @@ -50,18 +51,18 @@ class Supplier extends AbstractCompany * @ORM\OrderBy({"name" = "ASC"}) * @var Collection */ - protected $children; + protected Collection $children; /** * @ORM\ManyToOne(targetEntity="Supplier", inversedBy="children") * @ORM\JoinColumn(name="parent_id", referencedColumnName="id") */ - protected ?\App\Entity\Base\AbstractStructuralDBElement $parent; + protected ?AbstractStructuralDBElement $parent; /** * @ORM\OneToMany(targetEntity="App\Entity\PriceInformations\Orderdetail", mappedBy="supplier") */ - protected $orderdetails; + protected Collection $orderdetails; /** * @var Currency|null The currency that should be used by default for order informations with this supplier. @@ -86,14 +87,14 @@ class Supplier extends AbstractCompany * @ORM\OrderBy({"name" = "ASC"}) * @Assert\Valid() */ - protected $attachments; + protected Collection $attachments; /** @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Parameters\SupplierParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @Assert\Valid() */ - protected $parameters; + protected Collection $parameters; /** * Gets the currency that should be used by default, when creating a orderdetail with this supplier. diff --git a/src/Entity/PriceInformations/Currency.php b/src/Entity/PriceInformations/Currency.php index 4f6e0923..6b78de19 100644 --- a/src/Entity/PriceInformations/Currency.php +++ b/src/Entity/PriceInformations/Currency.php @@ -69,7 +69,7 @@ class Currency extends AbstractStructuralDBElement * @ORM\OneToMany(targetEntity="Currency", mappedBy="parent", cascade={"persist"}) * @ORM\OrderBy({"name" = "ASC"}) */ - protected $children; + protected Collection $children; /** * @ORM\ManyToOne(targetEntity="Currency", inversedBy="children") @@ -83,19 +83,19 @@ class Currency extends AbstractStructuralDBElement * @ORM\OrderBy({"name" = "ASC"}) * @Assert\Valid() */ - protected $attachments; + protected Collection $attachments; /** @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Parameters\CurrencyParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @Assert\Valid() */ - protected $parameters; + protected Collection $parameters; /** @var Collection * @ORM\OneToMany(targetEntity="App\Entity\PriceInformations\Pricedetail", mappedBy="currency") */ - protected $pricedetails; + protected Collection $pricedetails; public function __construct() { diff --git a/src/Entity/ProjectSystem/Project.php b/src/Entity/ProjectSystem/Project.php index ab0f2739..0ffcbfe8 100644 --- a/src/Entity/ProjectSystem/Project.php +++ b/src/Entity/ProjectSystem/Project.php @@ -47,7 +47,7 @@ class Project extends AbstractStructuralDBElement * @ORM\OrderBy({"name" = "ASC"}) * @var Collection */ - protected $children; + protected Collection $children; /** * @ORM\ManyToOne(targetEntity="Project", inversedBy="children") @@ -98,13 +98,13 @@ class Project extends AbstractStructuralDBElement * @ORM\OneToMany(targetEntity="App\Entity\Attachments\ProjectAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OrderBy({"name" = "ASC"}) */ - protected $attachments; + protected Collection $attachments; /** @var Collection * @ORM\OneToMany(targetEntity="App\Entity\Parameters\ProjectParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) */ - protected $parameters; + protected Collection $parameters; /******************************************************************************** * diff --git a/src/Entity/UserSystem/Group.php b/src/Entity/UserSystem/Group.php index e07d6fad..08976c30 100644 --- a/src/Entity/UserSystem/Group.php +++ b/src/Entity/UserSystem/Group.php @@ -49,7 +49,7 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa * @ORM\OrderBy({"name" = "ASC"}) * @var Collection */ - protected $children; + protected Collection $children; /** * @ORM\ManyToOne(targetEntity="Group", inversedBy="children") @@ -61,7 +61,7 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa * @ORM\OneToMany(targetEntity="User", mappedBy="group") * @var Collection */ - protected $users; + protected Collection $users; /** * @var bool If true all users associated with this group must have enabled some kind of 2 factor authentication @@ -75,7 +75,7 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa * @ORM\OrderBy({"name" = "ASC"}) * @Assert\Valid() */ - protected $attachments; + protected Collection $attachments; /** * @var PermissionData|null @@ -90,7 +90,7 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa * @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"}) * @Assert\Valid() */ - protected $parameters; + protected Collection $parameters; public function __construct() { diff --git a/src/Entity/UserSystem/User.php b/src/Entity/UserSystem/User.php index 77182159..b809d717 100644 --- a/src/Entity/UserSystem/User.php +++ b/src/Entity/UserSystem/User.php @@ -226,7 +226,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe * @ORM\OneToMany(targetEntity="App\Entity\Attachments\UserAttachment", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true) * @ORM\OrderBy({"name" = "ASC"}) */ - protected $attachments; + protected Collection $attachments; /** @var DateTime|null The time when the backup codes were generated * @ORM\Column(type="datetime", nullable=true) @@ -237,13 +237,13 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe /** @var Collection * @ORM\OneToMany(targetEntity="App\Entity\UserSystem\U2FKey", mappedBy="user", cascade={"REMOVE"}, orphanRemoval=true) */ - protected $u2fKeys; + protected Collection $u2fKeys; /** * @var Collection * @ORM\OneToMany(targetEntity="App\Entity\UserSystem\WebauthnKey", mappedBy="user", cascade={"REMOVE"}, orphanRemoval=true) */ - protected $webauthn_keys; + protected Collection $webauthn_keys; /** * @var Currency|null The currency the user wants to see prices in. diff --git a/src/Helpers/Trees/TreeViewNode.php b/src/Helpers/Trees/TreeViewNode.php index f43a1eb6..85053239 100644 --- a/src/Helpers/Trees/TreeViewNode.php +++ b/src/Helpers/Trees/TreeViewNode.php @@ -36,11 +36,11 @@ final class TreeViewNode implements JsonSerializable private ?TreeViewNodeState $state = null; - private ?array $tags; + private ?array $tags = null; - private ?int $id; + private ?int $id = null; - private ?string $icon; + private ?string $icon = null; /** * Creates a new TreeView node with the given parameters. diff --git a/src/Repository/UserRepository.php b/src/Repository/UserRepository.php index 6913dea4..3cc29788 100644 --- a/src/Repository/UserRepository.php +++ b/src/Repository/UserRepository.php @@ -35,7 +35,7 @@ use Symfony\Component\Security\Core\User\UserInterface; */ final class UserRepository extends NamedDBElementRepository implements PasswordUpgraderInterface { - protected ?User $anonymous_user; + protected ?User $anonymous_user = null; /** * Returns the anonymous user.