Skip to content

Commit 3d76eb4

Browse files
author
Cristoforo Cervino
committed
removes doctrine annotations
1 parent dab2499 commit 3d76eb4

File tree

8 files changed

+43
-82
lines changed

8 files changed

+43
-82
lines changed

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@
2929
"doctrine/doctrine-bundle": "^2.2",
3030
"roave/security-advisories": "dev-master",
3131
"phpunit/phpunit": "^9.5",
32-
"symfony/framework-bundle": "^4.4 | ^5.0",
32+
"symfony/framework-bundle": "^4.4 | ^5.0 | ^6.0 | ^7.0",
3333
"symfony/yaml": "^5.2",
3434
"ext-json": "*",
35-
"friendsofphp/php-cs-fixer": "^3.35",
36-
"doctrine/annotations": "^2.0",
35+
"friendsofphp/php-cs-fixer": "^3.58",
3736
"phpstan/phpstan": "^1.10",
3837
"phpstan/phpstan-phpunit": "^1.3",
3938
"phpstan/extension-installer": "^1.3",

tests/HttpKernel/config/config_test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ doctrine:
2222
auto_mapping: true
2323
mappings:
2424
fixtures:
25-
type: annotation
25+
type: attribute
2626
prefix: 'Andante\Doctrine\ORM\Tests\Model'
2727
dir: '%kernel.project_dir%/tests/Model/'
2828
is_bundle: false

tests/Model/Address.php

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,17 @@
44

55
namespace Andante\Doctrine\ORM\Tests\Model;
66

7+
use Doctrine\DBAL\Types\Types;
78
use Doctrine\ORM\Mapping as ORM;
89

9-
/**
10-
* @ORM\Entity()
11-
*/
10+
#[ORM\Entity]
1211
class Address
1312
{
14-
/**
15-
* @ORM\Id()
16-
* @ORM\GeneratedValue()
17-
* @ORM\Column(type="integer")
18-
*/
13+
#[ORM\Id]
14+
#[ORM\GeneratedValue]
15+
#[ORM\Column(Types::INTEGER)]
1916
private ?int $id = null;
20-
21-
/**
22-
* @ORM\Column(type="string", nullable=true)
23-
*/
17+
#[ORM\Column(Types::STRING, null, null, null, null, false, true)]
2418
private ?string $name = null;
2519

2620
public function getId(): ?int

tests/Model/Document.php

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,18 @@
44

55
namespace Andante\Doctrine\ORM\Tests\Model;
66

7+
use Doctrine\DBAL\Types\Types;
78
use Doctrine\ORM\Mapping as ORM;
89

9-
/**
10-
* @ORM\Entity()
11-
*/
10+
#[ORM\Entity]
1211
class Document
1312
{
14-
/**
15-
* @ORM\Id()
16-
* @ORM\GeneratedValue()
17-
* @ORM\Column(type="integer")
18-
*/
13+
#[ORM\Id]
14+
#[ORM\GeneratedValue]
15+
#[ORM\Column(Types::INTEGER)]
1916
private ?int $id = null;
2017

21-
/**
22-
* @ORM\Column(type="string", nullable=true)
23-
*/
18+
#[ORM\Column(Types::STRING, null, null, null, null, false, true)]
2419
private ?string $name = null;
2520

2621
public function getId(): ?int

tests/Model/Employee.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,11 @@
88
use Doctrine\Common\Collections\Collection;
99
use Doctrine\ORM\Mapping as ORM;
1010

11-
/**
12-
* @ORM\Entity()
13-
*/
11+
#[ORM\Entity]
1412
class Employee extends Person
1513
{
16-
/**
17-
* @var Collection<int, Paper>
18-
* @ORM\OneToMany(targetEntity="Paper", mappedBy="employee")
19-
*/
14+
/** @var Collection<int, Paper> */
15+
#[ORM\OneToMany('employee', Paper::class)]
2016
private Collection $papers;
2117

2218
public function __construct()

tests/Model/Organization.php

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,25 @@
66

77
use Doctrine\Common\Collections\ArrayCollection;
88
use Doctrine\Common\Collections\Collection;
9+
use Doctrine\DBAL\Types\Types;
910
use Doctrine\ORM\Mapping as ORM;
1011

11-
/**
12-
* @ORM\Entity()
13-
*/
12+
#[ORM\Entity]
1413
class Organization
1514
{
16-
/**
17-
* @ORM\Id()
18-
* @ORM\GeneratedValue()
19-
* @ORM\Column(type="integer")
20-
*/
15+
#[ORM\Id]
16+
#[ORM\GeneratedValue]
17+
#[ORM\Column(Types::INTEGER)]
2118
private ?int $id = null;
2219

23-
/**
24-
* @ORM\ManyToOne(targetEntity="Address")
25-
*/
20+
#[ORM\ManyToOne(Address::class)]
2621
private ?Address $address = null;
2722

28-
/**
29-
* @var Collection<int, Person>
30-
* @ORM\ManyToMany(targetEntity="Person")
31-
*/
23+
/** @var Collection<int, Person> */
24+
#[ORM\ManyToMany(Person::class)]
3225
private Collection $persons;
3326

34-
/**
35-
* @ORM\Column(type="string", nullable=true)
36-
*/
27+
#[ORM\Column(Types::STRING, null, null, null, null, false, true)]
3728
private ?string $name = null;
3829

3930
public function __construct()

tests/Model/Paper.php

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,25 @@
66

77
use Doctrine\Common\Collections\ArrayCollection;
88
use Doctrine\Common\Collections\Collection;
9+
use Doctrine\DBAL\Types\Types;
910
use Doctrine\ORM\Mapping as ORM;
1011

11-
/**
12-
* @ORM\Entity()
13-
*/
12+
#[ORM\Entity]
1413
class Paper
1514
{
16-
/**
17-
* @ORM\Id()
18-
* @ORM\GeneratedValue()
19-
* @ORM\Column(type="integer")
20-
*/
15+
#[ORM\Id]
16+
#[ORM\GeneratedValue]
17+
#[ORM\Column(Types::INTEGER)]
2118
private ?int $id = null;
2219

23-
/**
24-
* @ORM\Column(type="string", nullable=true)
25-
*/
20+
#[ORM\Column(Types::STRING, null, null, null, null, false, true)]
2621
private ?string $name = null;
2722

28-
/**
29-
* @var Collection<int, Employee>
30-
* @ORM\OneToMany(targetEntity="Employee", mappedBy="papers")
31-
*/
23+
/** @var Collection<int, Employee> */
24+
#[ORM\OneToMany('papers', Employee::class)]
3225
private Collection $employees;
3326

34-
/**
35-
* @ORM\ManyToOne(targetEntity="Document")
36-
*/
27+
#[ORM\ManyToOne(Document::class)]
3728
private ?Document $document = null;
3829

3930
public function __construct()

tests/Model/Person.php

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,19 @@
44

55
namespace Andante\Doctrine\ORM\Tests\Model;
66

7+
use Doctrine\DBAL\Types\Types;
78
use Doctrine\ORM\Mapping as ORM;
89

9-
/**
10-
* @ORM\Entity
11-
* @ORM\InheritanceType("JOINED")
12-
*/
10+
#[ORM\Entity]
11+
#[ORM\InheritanceType('JOINED')]
1312
class Person
1413
{
15-
/**
16-
* @ORM\Id()
17-
* @ORM\GeneratedValue()
18-
* @ORM\Column(type="integer")
19-
*/
14+
#[ORM\Id]
15+
#[ORM\GeneratedValue]
16+
#[ORM\Column(Types::INTEGER)]
2017
private ?int $id = null;
2118

22-
/**
23-
* @ORM\Column(type="string", nullable=true)
24-
*/
19+
#[ORM\Column(Types::STRING, null, null, null, null, false, true)]
2520
private ?string $name = null;
2621

2722
public function getId(): ?int

0 commit comments

Comments
 (0)