Skip to content

Commit 76b0189

Browse files
committed
switch doctrine annotations to attributes to resolve deprecations
1 parent b3a4705 commit 76b0189

File tree

8 files changed

+36
-82
lines changed

8 files changed

+36
-82
lines changed

src/LiveComponent/tests/Fixtures/Entity/CategoryFixtureEntity.php

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,15 @@
1313

1414
use Doctrine\ORM\Mapping as ORM;
1515

16-
/**
17-
* @ORM\Entity
18-
*/
16+
#[ORM\Entity]
1917
class CategoryFixtureEntity
2018
{
21-
/**
22-
* @ORM\Id
23-
* @ORM\GeneratedValue
24-
* @ORM\Column(type="integer")
25-
*/
19+
#[ORM\Id]
20+
#[ORM\GeneratedValue]
21+
#[ORM\Column(type: 'integer')]
2622
private ?int $id = null;
2723

28-
/**
29-
* @ORM\Column(type="string")
30-
*/
24+
#[ORM\Column(type: 'string')]
3125
private ?string $name = null;
3226

3327
public function getId(): ?int

src/LiveComponent/tests/Fixtures/Entity/Embeddable1.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,10 @@
1313

1414
use Doctrine\ORM\Mapping as ORM;
1515

16-
/**
17-
* @ORM\Embeddable
18-
*/
16+
#[ORM\Embeddable]
1917
final class Embeddable1
2018
{
21-
/**
22-
* @ORM\Column
23-
*/
19+
#[ORM\Column]
2420
public string $name;
2521

2622
public function __construct(string $name)

src/LiveComponent/tests/Fixtures/Entity/Entity1.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,11 @@
1313

1414
use Doctrine\ORM\Mapping as ORM;
1515

16-
/**
17-
* @ORM\Entity
18-
*/
16+
#[ORM\Entity]
1917
class Entity1
2018
{
21-
/**
22-
* @ORM\Id
23-
* @ORM\GeneratedValue
24-
* @ORM\Column(type="integer")
25-
*/
19+
#[ORM\Id]
20+
#[ORM\GeneratedValue]
21+
#[ORM\Column(type: 'integer')]
2622
public $id;
2723
}

src/LiveComponent/tests/Fixtures/Entity/Entity2.php

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,17 @@
1414
use Doctrine\ORM\Mapping as ORM;
1515
use Symfony\UX\LiveComponent\Tests\Fixtures\Dto\Embeddable2;
1616

17-
/**
18-
* @ORM\Entity
19-
*/
17+
#[ORM\Entity]
2018
class Entity2
2119
{
22-
/**
23-
* @ORM\Id
24-
* @ORM\GeneratedValue
25-
* @ORM\Column(type="integer")
26-
*/
20+
#[ORM\Id]
21+
#[ORM\GeneratedValue]
22+
#[ORM\Column(type: 'integer')]
2723
public $id;
2824

29-
/**
30-
* @ORM\Embedded(Embeddable1::class)
31-
*/
25+
#[ORM\Embedded(Embeddable1::class)]
3226
public Embeddable1 $embedded1;
3327

34-
/**
35-
* @ORM\Embedded(Embeddable2::class)
36-
*/
28+
#[ORM\Embedded(Embeddable2::class)]
3729
public Embeddable2 $embedded2;
3830
}

src/LiveComponent/tests/Fixtures/Entity/ProductFixtureEntity.php

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,17 @@
1313

1414
use Doctrine\ORM\Mapping as ORM;
1515

16-
/**
17-
* @ORM\Entity
18-
*/
16+
#[ORM\Entity]
1917
class ProductFixtureEntity
2018
{
21-
/**
22-
* @ORM\Id
23-
* @ORM\GeneratedValue
24-
* @ORM\Column(type="integer")
25-
*/
19+
#[ORM\Id]
20+
#[ORM\GeneratedValue]
21+
#[ORM\Column(type: 'integer')]
2622
public ?int $id = null;
2723

28-
/**
29-
* @ORM\Column(type="string")
30-
*/
24+
#[ORM\Column(type: 'string')]
3125
public string $name = '';
3226

33-
/**
34-
* @ORM\Column(type="integer")
35-
*/
27+
#[ORM\Column(type: 'integer')]
3628
public int $price = 0;
3729
}

src/LiveComponent/tests/Fixtures/Entity/TodoItemFixtureEntity.php

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,18 @@
1515
use Doctrine\Common\Collections\Collection;
1616
use Doctrine\ORM\Mapping as ORM;
1717

18-
/**
19-
* @ORM\Entity
20-
*/
18+
#[ORM\Entity]
2119
class TodoItemFixtureEntity
2220
{
23-
/**
24-
* @ORM\Id
25-
* @ORM\GeneratedValue
26-
* @ORM\Column(type="integer")
27-
*/
21+
#[ORM\Id]
22+
#[ORM\GeneratedValue]
23+
#[ORM\Column(type: 'integer')]
2824
public $id;
2925

30-
/**
31-
* @ORM\Column(type="string")
32-
*/
26+
#[ORM\Column(type: 'string')]
3327
private ?string $name = null;
3428

35-
/**
36-
* @ORM\ManyToOne(targetEntity=TodoListFixtureEntity::class, inversedBy="todoItems")
37-
*/
29+
#[ORM\ManyToOne(targetEntity: TodoListFixtureEntity::class, inversedBy: 'todoItems')]
3830
private TodoListFixtureEntity $todoList;
3931

4032
/**

src/LiveComponent/tests/Fixtures/Entity/TodoListFixtureEntity.php

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,18 @@
1515
use Doctrine\Common\Collections\Collection;
1616
use Doctrine\ORM\Mapping as ORM;
1717

18-
/**
19-
* @ORM\Entity
20-
*/
18+
#[ORM\Entity]
2119
class TodoListFixtureEntity
2220
{
23-
/**
24-
* @ORM\Id
25-
* @ORM\GeneratedValue
26-
* @ORM\Column(type="integer")
27-
*/
21+
#[ORM\Id]
22+
#[ORM\GeneratedValue]
23+
#[ORM\Column(type: 'integer')]
2824
public $id;
2925

30-
/**
31-
* @ORM\Column(type="string")
32-
*/
26+
#[ORM\Column(type: 'string')]
3327
public string $listTitle = '';
3428

35-
/**
36-
* @ORM\OneToMany(targetEntity=TodoItemFixtureEntity::class, mappedBy="todoList")
37-
*/
29+
#[ORM\OneToMany(targetEntity: TodoItemFixtureEntity::class, mappedBy: 'todoList')]
3830
private Collection $todoItems;
3931

4032
public function __construct(string $listTitle = '')

src/LiveComponent/tests/Fixtures/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ protected function configureContainer(ContainerConfigurator $c): void
8484
'mappings' => [
8585
'Default' => [
8686
'is_bundle' => false,
87-
'type' => 'annotation',
87+
'type' => 'attribute',
8888
'dir' => '%kernel.project_dir%/tests/Fixtures/Entity',
8989
'prefix' => 'Symfony\UX\LiveComponent\Tests\Fixtures\Entity',
9090
'alias' => 'Default',

0 commit comments

Comments
 (0)