Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] Support for ORM 3 #753

Open
wants to merge 6 commits into
base: 6.2.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,24 @@
"require": {
"php": "~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
"ext-json": "*",
"doctrine/dbal": "^2.13.7 || ^3.3.2",
"doctrine/dbal": "^2.13.7 || ^3.3.2 || ~4.0.0",
"doctrine/doctrine-laminas-hydrator": "^3.0.0",
"doctrine/doctrine-module": "^5.3.0 || ^6.0.2",
"doctrine/event-manager": "^1.1.1",
"doctrine/orm": "^2.11.1",
"doctrine/event-manager": "^1.1.1 || ^2.0.0",
"doctrine/orm": "^3.0.0",
"doctrine/persistence": "^2.3.0 || ^3.0.0",
"laminas/laminas-eventmanager": "^3.4.0",
"laminas/laminas-modulemanager": "^2.11.0",
"laminas/laminas-mvc": "^3.3.2",
"laminas/laminas-paginator": "^2.12.2",
"laminas/laminas-servicemanager": "^3.17.0",
"laminas/laminas-stdlib": "^3.7.1",
"psr/container": "^1.1.2",
"symfony/console": "^5.4.3 || ^6.0.3"
"psr/container": "^1.1.2 || ^2.0.0",
"symfony/console": "^5.4.3 || ^6.0.3 || ^7.0.0"
},
"require-dev": {
"doctrine/annotations": "^1.13.2",
"doctrine/coding-standard": "^9.0.0",
"doctrine/annotations": "^2.0",
"doctrine/coding-standard": "^12.0.0",
"doctrine/data-fixtures": "^1.5.2",
"doctrine/migrations": "^3.4.1",
"laminas/laminas-cache-storage-adapter-filesystem": "^2.0",
Expand All @@ -80,7 +80,7 @@
"ocramius/proxy-manager": "^2.2.0",
"phpstan/phpstan": "^1.4.6",
"phpstan/phpstan-phpunit": "^1.0.0",
"phpunit/phpunit": "^9.5.13",
"phpunit/phpunit": "^10.0.0",
"squizlabs/php_codesniffer": "^3.6.2",
"vimeo/psalm": "^5.4.0"
},
Expand Down
32 changes: 14 additions & 18 deletions tests/Assets/Entity/Test.php → tests/Assets/Entity/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,22 @@

use Doctrine\ORM\Mapping as ORM;

/**
* @ORM\Entity
* @ORM\Table(name="doctrine_orm_module_test")
*/
class Test
#[ORM\Entity]
#[ORM\Table(name: 'doctrine_orm_module_auth')]
class Auth
{
/**
* @ORM\Id
* @ORM\Column(type="integer");
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected int $id;
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private int $id;

/** @ORM\Column(type="string", nullable=true) */
protected string $username;
#[ORM\Column(type: 'string', nullable: true)]
private string $username;

/** @ORM\Column(type="string", nullable=true) */
protected string $password;
#[ORM\Column(type: 'string', nullable: true)]
private string $password;

public function getId(): ?int
public function getId(): int|null
{
return $this->id;
}
Expand All @@ -35,7 +31,7 @@ public function setPassword(string $password): void
$this->password = (string) $password;
}

public function getPassword(): ?string
public function getPassword(): string|null
{
return $this->password;
}
Expand All @@ -45,7 +41,7 @@ public function setUsername(string $username): void
$this->username = (string) $username;
}

public function getUsername(): ?string
public function getUsername(): string|null
{
return $this->username;
}
Expand Down
22 changes: 9 additions & 13 deletions tests/Assets/Entity/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,19 @@

use Doctrine\ORM\Mapping as ORM;

/**
* @ORM\Entity
* @ORM\Table(name="doctrine_orm_module_category")
*/
#[ORM\Entity]
#[ORM\Table(name: 'doctrine_orm_module_category')]
class Category
{
/**
* @ORM\Id
* @ORM\Column(type="integer");
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected int $id;
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private int $id;

/** @ORM\Column(type="string", nullable=true) */
protected string $name;
#[ORM\Column(type: 'string', nullable: true)]
private string $name;

public function getId(): ?int
public function getId(): int|null
{
return $this->id;
}
Expand Down
27 changes: 12 additions & 15 deletions tests/Assets/Entity/City.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,23 @@

use Doctrine\ORM\Mapping as ORM;

/**
* @ORM\Entity
* @ORM\Table(name="doctrine_orm_module_city")
*/
#[ORM\Entity]
#[ORM\Table(name: 'doctrine_orm_module_city')]
class City
{
/**
* @ORM\Id
* @ORM\Column(type="integer");
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected int $id;
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private int $id;

/** @ORM\Column(type="string", nullable=true) */
protected string $name;
#[ORM\Column(type: 'string', nullable: true)]
private string $name;

/** @ORM\OneToOne(targetEntity="Country") */
protected Country $country;
#[ORM\OneToOne(targetEntity: Country::class)]
#[ORM\JoinColumn(name: 'country_id', referencedColumnName: 'id')]
private Country $country;

public function getId(): ?int
public function getId(): int|null
{
return $this->id;
}
Expand Down
22 changes: 9 additions & 13 deletions tests/Assets/Entity/Country.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,19 @@

use Doctrine\ORM\Mapping as ORM;

/**
* @ORM\Entity
* @ORM\Table(name="doctrine_orm_module_country")
*/
#[ORM\Entity]
#[ORM\Table(name: 'doctrine_orm_module_country')]
class Country
{
/**
* @ORM\Id
* @ORM\Column(type="integer");
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected int $id;
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private int $id;

/** @ORM\Column(type="string", nullable=true) */
protected string $name;
#[ORM\Column(type: 'string', nullable: true)]
private string $name;

public function getId(): ?int
public function getId(): int|null
{
return $this->id;
}
Expand Down
22 changes: 9 additions & 13 deletions tests/Assets/Entity/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,19 @@
use DateTime;
use Doctrine\ORM\Mapping as ORM;

/**
* @ORM\Entity
* @ORM\Table(name="doctrine_orm_module_date")
*/
#[ORM\Entity]
#[ORM\Table(name: 'doctrine_orm_module_date')]
class Date
{
/**
* @ORM\Id
* @ORM\Column(type="integer");
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected int $id;
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private int $id;

/** @ORM\Column(type="date", nullable=true) */
protected DateTime $date;
#[ORM\Column(type: 'date', nullable: true)]
private DateTime $date;

public function getId(): ?int
public function getId(): int|null
{
return $this->id;
}
Expand Down
16 changes: 6 additions & 10 deletions tests/Assets/Entity/EntityWithoutRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,15 @@

use Doctrine\ORM\Mapping as ORM;

/**
* @ORM\Entity
*/
#[ORM\Entity]
class EntityWithoutRepository
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private ?int $id = null;
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private int|null $id = null;

public function getId(): ?int
public function getId(): int|null
{
return $this->id;
}
Expand Down
Loading
Loading