From 3e380f82d2477dc41d810cd990b574c149a1b442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sat, 3 Jan 2026 22:18:10 +0100 Subject: [PATCH] Revert "Declare nativeType of parent property explicitly as workaround for bug in symfony TypeInfo" This reverts commit 2f580c92d1004f5f1e99ef9071a0029e4a352cf6. --- src/Entity/Attachments/AttachmentType.php | 4 +--- src/Entity/Parts/Category.php | 4 +--- src/Entity/Parts/Footprint.php | 4 +--- src/Entity/Parts/Manufacturer.php | 4 +--- src/Entity/Parts/MeasurementUnit.php | 4 +--- src/Entity/Parts/PartCustomState.php | 4 +--- src/Entity/Parts/StorageLocation.php | 4 +--- src/Entity/Parts/Supplier.php | 4 +--- src/Entity/PriceInformations/Currency.php | 4 +--- src/Entity/ProjectSystem/Project.php | 4 +--- 10 files changed, 10 insertions(+), 30 deletions(-) diff --git a/src/Entity/Attachments/AttachmentType.php b/src/Entity/Attachments/AttachmentType.php index b5d1ff8c..22333c16 100644 --- a/src/Entity/Attachments/AttachmentType.php +++ b/src/Entity/Attachments/AttachmentType.php @@ -47,8 +47,6 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Annotation\Groups; -use Symfony\Component\TypeInfo\Type\NullableType; -use Symfony\Component\TypeInfo\Type\ObjectType; use Symfony\Component\Validator\Constraints as Assert; /** @@ -95,7 +93,7 @@ class AttachmentType extends AbstractStructuralDBElement #[ORM\ManyToOne(targetEntity: AttachmentType::class, inversedBy: 'children')] #[ORM\JoinColumn(name: 'parent_id')] #[Groups(['attachment_type:read', 'attachment_type:write'])] - #[ApiProperty(readableLink: true, writableLink: false, nativeType: new NullableType(new ObjectType(self::class)))] + #[ApiProperty(readableLink: true, writableLink: false)] protected ?AbstractStructuralDBElement $parent = null; /** diff --git a/src/Entity/Parts/Category.php b/src/Entity/Parts/Category.php index a9efd2fa..7fca81bc 100644 --- a/src/Entity/Parts/Category.php +++ b/src/Entity/Parts/Category.php @@ -50,8 +50,6 @@ use App\Entity\Parameters\CategoryParameter; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Annotation\Groups; -use Symfony\Component\TypeInfo\Type\NullableType; -use Symfony\Component\TypeInfo\Type\ObjectType; use Symfony\Component\Validator\Constraints as Assert; /** @@ -100,7 +98,7 @@ class Category extends AbstractPartsContainingDBElement #[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'children')] #[ORM\JoinColumn(name: 'parent_id')] #[Groups(['category:read', 'category:write'])] - #[ApiProperty(readableLink: false, writableLink: false, nativeType: new NullableType(new ObjectType(self::class)))] + #[ApiProperty(readableLink: false, writableLink: false)] protected ?AbstractStructuralDBElement $parent = null; #[Groups(['category:read', 'category:write'])] diff --git a/src/Entity/Parts/Footprint.php b/src/Entity/Parts/Footprint.php index 251232c1..6b043562 100644 --- a/src/Entity/Parts/Footprint.php +++ b/src/Entity/Parts/Footprint.php @@ -49,8 +49,6 @@ use App\Entity\Parameters\FootprintParameter; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Annotation\Groups; -use Symfony\Component\TypeInfo\Type\NullableType; -use Symfony\Component\TypeInfo\Type\ObjectType; use Symfony\Component\Validator\Constraints as Assert; /** @@ -95,7 +93,7 @@ class Footprint extends AbstractPartsContainingDBElement #[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'children')] #[ORM\JoinColumn(name: 'parent_id')] #[Groups(['footprint:read', 'footprint:write'])] - #[ApiProperty(readableLink: false, writableLink: false, nativeType: new NullableType(new ObjectType(self::class)))] + #[ApiProperty(readableLink: false, writableLink: false)] protected ?AbstractStructuralDBElement $parent = null; #[ORM\OneToMany(mappedBy: 'parent', targetEntity: self::class)] diff --git a/src/Entity/Parts/Manufacturer.php b/src/Entity/Parts/Manufacturer.php index f7bee4b8..0edf8232 100644 --- a/src/Entity/Parts/Manufacturer.php +++ b/src/Entity/Parts/Manufacturer.php @@ -48,8 +48,6 @@ use App\Entity\Parameters\ManufacturerParameter; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Annotation\Groups; -use Symfony\Component\TypeInfo\Type\NullableType; -use Symfony\Component\TypeInfo\Type\ObjectType; use Symfony\Component\Validator\Constraints as Assert; /** @@ -94,7 +92,7 @@ class Manufacturer extends AbstractCompany #[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'children')] #[ORM\JoinColumn(name: 'parent_id')] #[Groups(['manufacturer:read', 'manufacturer:write'])] - #[ApiProperty(readableLink: false, writableLink: false, nativeType: new NullableType(new ObjectType(self::class)))] + #[ApiProperty(readableLink: false, writableLink: false)] protected ?AbstractStructuralDBElement $parent = null; #[ORM\OneToMany(mappedBy: 'parent', targetEntity: self::class)] diff --git a/src/Entity/Parts/MeasurementUnit.php b/src/Entity/Parts/MeasurementUnit.php index dfb7e1d4..6dd0b9f2 100644 --- a/src/Entity/Parts/MeasurementUnit.php +++ b/src/Entity/Parts/MeasurementUnit.php @@ -50,8 +50,6 @@ use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Serializer\Annotation\Groups; -use Symfony\Component\TypeInfo\Type\NullableType; -use Symfony\Component\TypeInfo\Type\ObjectType; use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Constraints\Length; @@ -132,7 +130,7 @@ class MeasurementUnit extends AbstractPartsContainingDBElement #[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'children')] #[ORM\JoinColumn(name: 'parent_id')] #[Groups(['measurement_unit:read', 'measurement_unit:write'])] - #[ApiProperty(readableLink: false, writableLink: false, nativeType: new NullableType(new ObjectType(self::class)))] + #[ApiProperty(readableLink: false, writableLink: false)] protected ?AbstractStructuralDBElement $parent = null; /** diff --git a/src/Entity/Parts/PartCustomState.php b/src/Entity/Parts/PartCustomState.php index 77530ff6..136ff984 100644 --- a/src/Entity/Parts/PartCustomState.php +++ b/src/Entity/Parts/PartCustomState.php @@ -46,8 +46,6 @@ use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Criteria; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Annotation\Groups; -use Symfony\Component\TypeInfo\Type\NullableType; -use Symfony\Component\TypeInfo\Type\ObjectType; use Symfony\Component\Validator\Constraints as Assert; /** @@ -89,7 +87,7 @@ class PartCustomState extends AbstractPartsContainingDBElement #[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'children')] #[ORM\JoinColumn(name: 'parent_id')] #[Groups(['part_custom_state:read', 'part_custom_state:write'])] - #[ApiProperty(readableLink: false, writableLink: false, nativeType: new NullableType(new ObjectType(self::class)))] + #[ApiProperty(readableLink: false, writableLink: false)] protected ?AbstractStructuralDBElement $parent = null; /** diff --git a/src/Entity/Parts/StorageLocation.php b/src/Entity/Parts/StorageLocation.php index ca76df59..6c455ae5 100644 --- a/src/Entity/Parts/StorageLocation.php +++ b/src/Entity/Parts/StorageLocation.php @@ -50,8 +50,6 @@ use App\Entity\UserSystem\User; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Annotation\Groups; -use Symfony\Component\TypeInfo\Type\NullableType; -use Symfony\Component\TypeInfo\Type\ObjectType; use Symfony\Component\Validator\Constraints as Assert; /** @@ -99,7 +97,7 @@ class StorageLocation extends AbstractPartsContainingDBElement #[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'children')] #[ORM\JoinColumn(name: 'parent_id')] #[Groups(['location:read', 'location:write'])] - #[ApiProperty(readableLink: false, writableLink: false, nativeType: new NullableType(new ObjectType(self::class)))] + #[ApiProperty(readableLink: false, writableLink: false)] protected ?AbstractStructuralDBElement $parent = null; #[Groups(['location:read', 'location:write'])] diff --git a/src/Entity/Parts/Supplier.php b/src/Entity/Parts/Supplier.php index a073e9e4..2c004e9e 100644 --- a/src/Entity/Parts/Supplier.php +++ b/src/Entity/Parts/Supplier.php @@ -53,8 +53,6 @@ use Brick\Math\BigDecimal; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Annotation\Groups; -use Symfony\Component\TypeInfo\Type\NullableType; -use Symfony\Component\TypeInfo\Type\ObjectType; use Symfony\Component\Validator\Constraints as Assert; /** @@ -101,7 +99,7 @@ class Supplier extends AbstractCompany #[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'children')] #[ORM\JoinColumn(name: 'parent_id')] #[Groups(['supplier:read', 'supplier:write'])] - #[ApiProperty(readableLink: false, writableLink: false, nativeType: new NullableType(new ObjectType(self::class)))] + #[ApiProperty(readableLink: false, writableLink: false)] protected ?AbstractStructuralDBElement $parent = null; /** diff --git a/src/Entity/PriceInformations/Currency.php b/src/Entity/PriceInformations/Currency.php index 4bf9df4e..ce20caf8 100644 --- a/src/Entity/PriceInformations/Currency.php +++ b/src/Entity/PriceInformations/Currency.php @@ -52,8 +52,6 @@ use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; use Symfony\Component\Serializer\Annotation\Groups; -use Symfony\Component\TypeInfo\Type\NullableType; -use Symfony\Component\TypeInfo\Type\ObjectType; use Symfony\Component\Validator\Constraints as Assert; /** @@ -127,7 +125,7 @@ class Currency extends AbstractStructuralDBElement #[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'children')] #[ORM\JoinColumn(name: 'parent_id')] #[Groups(['currency:read', 'currency:write'])] - #[ApiProperty(readableLink: false, writableLink: false, nativeType: new NullableType(new ObjectType(self::class)))] + #[ApiProperty(readableLink: false, writableLink: false)] protected ?AbstractStructuralDBElement $parent = null; /** diff --git a/src/Entity/ProjectSystem/Project.php b/src/Entity/ProjectSystem/Project.php index 53f74af0..a103d694 100644 --- a/src/Entity/ProjectSystem/Project.php +++ b/src/Entity/ProjectSystem/Project.php @@ -49,8 +49,6 @@ use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use InvalidArgumentException; use Symfony\Component\Serializer\Annotation\Groups; -use Symfony\Component\TypeInfo\Type\NullableType; -use Symfony\Component\TypeInfo\Type\ObjectType; use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Context\ExecutionContextInterface; @@ -97,7 +95,7 @@ class Project extends AbstractStructuralDBElement #[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'children')] #[ORM\JoinColumn(name: 'parent_id')] #[Groups(['project:read', 'project:write'])] - #[ApiProperty(readableLink: false, writableLink: false, nativeType: new NullableType(new ObjectType(self::class)))] + #[ApiProperty(readableLink: false, writableLink: false)] protected ?AbstractStructuralDBElement $parent = null; #[Groups(['project:read', 'project:write'])]