Skip to content

Commit

Permalink
chore: migrate doctrine test entities to attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentchalamon committed Jan 14, 2024
1 parent d64a3f1 commit 462cc3a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 61 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
],
"require": {
"php": ">=7.4",
"php": ">=8.1",
"ircmaxell/random-lib": "^1.2",
"symfony/config": "^5.1 || ^6.0 || ^7.0",
"symfony/dependency-injection": "^5.1 || ^6.0 || ^7.0",
Expand Down
22 changes: 7 additions & 15 deletions features/app/src/Entity/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,33 @@
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;

/**
* @ORM\Entity
*/
#[ORM\Entity]
final class Admin implements UserInterface
{
/**
* @var int
*
* @ORM\Id
*
* @ORM\Column(type="integer")
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private $id;

/**
* @var string
*
* @ORM\Column(type="string")
*/
#[ORM\Column(type: 'string')]
private $email;

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

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

/**
Expand Down
19 changes: 6 additions & 13 deletions features/app/src/Entity/PasswordAdminToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,22 @@
use CoopTilleuls\ForgotPasswordBundle\Entity\AbstractPasswordToken;
use Doctrine\ORM\Mapping as ORM;

/**
* @ORM\Entity
*/
#[ORM\Entity]
final class PasswordAdminToken extends AbstractPasswordToken
{
/**
* @var int
*
* @ORM\Id
*
* @ORM\Column(type="integer")
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private $id;

/**
* @var Admin
*
* @ORM\ManyToOne(targetEntity=Admin::class)
*
* @ORM\JoinColumn(nullable=false, name="user_id")
*/
#[ORM\ManyToOne(targetEntity: Admin::class)]
#[ORM\JoinColumn(nullable: false, name: 'user_id')]
private $admin;

/**
Expand Down
21 changes: 6 additions & 15 deletions features/app/src/Entity/PasswordToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,22 @@
use CoopTilleuls\ForgotPasswordBundle\Entity\AbstractPasswordToken;
use Doctrine\ORM\Mapping as ORM;

/**
* @ORM\Entity
*
* @author Vincent CHALAMON <[email protected]>
*/
#[ORM\Entity]
final class PasswordToken extends AbstractPasswordToken
{
/**
* @var int
*
* @ORM\Id
*
* @ORM\Column(type="integer")
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private $id;

/**
* @var User
*
* @ORM\ManyToOne(targetEntity="User")
*
* @ORM\JoinColumn(nullable=false, name="user_id")
*/
#[ORM\ManyToOne(targetEntity: 'User')]
#[ORM\JoinColumn(nullable: false, name: 'user_id')]
private $user;

/**
Expand Down
24 changes: 7 additions & 17 deletions features/app/src/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,33 @@
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\User\UserInterface;

/**
* @ORM\Entity
*
* @author Vincent CHALAMON <[email protected]>
*/
#[ORM\Entity]
final class User implements UserInterface
{
/**
* @var int
*
* @ORM\Id
*
* @ORM\Column(type="integer")
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private $id;

/**
* @var string
*
* @ORM\Column(type="string")
*/
#[ORM\Column(type: 'string')]
private $email;

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

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

/**
Expand Down

0 comments on commit 462cc3a

Please sign in to comment.