diff --git a/tests/Assets/Entity/FormEntityTarget.php b/tests/Assets/Entity/FormEntityTarget.php index d5dc8d55..f25eb9b5 100644 --- a/tests/Assets/Entity/FormEntityTarget.php +++ b/tests/Assets/Entity/FormEntityTarget.php @@ -6,13 +6,11 @@ use Doctrine\ORM\Mapping as ORM; -/** @ORM\Entity */ +#[ORM\Entity] class FormEntityTarget { - /** - * @ORM\Id - * @ORM\Column(type="integer") - * @ORM\GeneratedValue(strategy="AUTO") - */ + #[ORM\Id] + #[ORM\Column(type: 'integer')] + #[ORM\GeneratedValue(strategy: 'AUTO')] protected int $id; } diff --git a/tests/Assets/Entity/Issue237.php b/tests/Assets/Entity/Issue237.php index 4e8008df..b2fc7e69 100644 --- a/tests/Assets/Entity/Issue237.php +++ b/tests/Assets/Entity/Issue237.php @@ -6,16 +6,12 @@ use Doctrine\ORM\Mapping as ORM; -/** - * @ORM\Entity - * @ORM\Table(name="doctrine_orm_module_form_entity_issue237") - */ +#[ORM\Entity] +#[ORM\Table(name: 'doctrine_orm_module_form_entity_issue237')] class Issue237 { - /** - * @ORM\Id - * @ORM\Column(type="integer") - * @ORM\GeneratedValue(strategy="IDENTITY") - */ + #[ORM\Id] + #[ORM\Column(type: 'integer')] + #[ORM\GeneratedValue(strategy: 'IDENTITY')] protected int $id; } diff --git a/tests/Assets/Entity/Product.php b/tests/Assets/Entity/Product.php index a1481c92..b96b3bf1 100644 --- a/tests/Assets/Entity/Product.php +++ b/tests/Assets/Entity/Product.php @@ -6,28 +6,21 @@ use Doctrine\ORM\Mapping as ORM; -/** - * @ORM\Entity - * @ORM\Table(name="doctrine_orm_module_product") - */ +#[ORM\Entity] +#[ORM\Table(name: 'doctrine_orm_module_product')] class Product { - /** - * @ORM\Id - * @ORM\Column(type="integer"); - * @ORM\GeneratedValue(strategy="AUTO") - */ + #[ORM\Id] + #[ORM\Column(type: 'integer')] + #[ORM\GeneratedValue(strategy: 'AUTO')] protected int $id; - /** @ORM\Column(type="string", nullable=true) */ + #[ORM\Column(type: 'string', nullable: true)] protected string $name; - /** - * @ORM\ManyToMany(targetEntity="Category") - * - * @var Category[] - */ - protected array $categories; + /** @var Category[] */ + #[ORM\ManyToMany(targetEntity: Category::class)] + private array $categories; public function getId(): int|null { diff --git a/tests/Assets/Entity/ResolveTarget.php b/tests/Assets/Entity/ResolveTarget.php index a74901f1..c28c74ef 100644 --- a/tests/Assets/Entity/ResolveTarget.php +++ b/tests/Assets/Entity/ResolveTarget.php @@ -6,16 +6,15 @@ use Doctrine\ORM\Mapping as ORM; -/** @ORM\Entity */ +#[ORM\Entity] class ResolveTarget { - /** - * @ORM\Id - * @ORM\Column(type="integer") - * @ORM\GeneratedValue(strategy="AUTO") - */ + #[ORM\Id] + #[ORM\Column(type: 'integer')] + #[ORM\GeneratedValue(strategy: 'AUTO')] protected int $id; - /** @ORM\OneToOne(targetEntity="Target") */ + #[ORM\ManyToOne(targetEntity: Target::class)] + #[ORM\JoinColumn(name: 'target_id', referencedColumnName: 'id')] protected Target $target; } diff --git a/tests/Assets/Entity/TargetEntity.php b/tests/Assets/Entity/TargetEntity.php index 1412fd9b..e2c41a51 100644 --- a/tests/Assets/Entity/TargetEntity.php +++ b/tests/Assets/Entity/TargetEntity.php @@ -6,14 +6,12 @@ use Doctrine\ORM\Mapping as ORM; -/** @ORM\Entity */ +#[ORM\Entity] class TargetEntity implements Target { - /** - * @ORM\Id - * @ORM\Column(type="integer") - * @ORM\GeneratedValue(strategy="AUTO") - */ + #[ORM\Id] + #[ORM\Column(type: 'integer')] + #[ORM\GeneratedValue(strategy: 'AUTO')] private int $id; public function getId(): int