Skip to content

Commit

Permalink
Use constants + attributes-only
Browse files Browse the repository at this point in the history
  • Loading branch information
apfelbox committed Dec 21, 2023
1 parent 6b2132d commit d445f5b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
14 changes: 4 additions & 10 deletions src/Entity/Traits/IdTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Torr\Rad\Entity\Traits;

use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Torr\Rad\Entity\Interfaces\EntityInterface;

Expand All @@ -11,17 +12,10 @@
trait IdTrait
{
/**
* @ORM\Id()
*
* @ORM\GeneratedValue(strategy="AUTO")
*
* @ORM\Column(name="id", type="integer")
*/
#[
ORM\Id(),
ORM\GeneratedValue(strategy: "AUTO"),
ORM\Column(name: "id", type: "integer")
]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: "AUTO")]
#[ORM\Column(name: "id", type: Types::INTEGER)]
private ?int $id = null;


Expand Down
4 changes: 2 additions & 2 deletions src/Entity/Traits/TimestampsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Torr\Rad\Entity\Traits;

use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;

/**
Expand All @@ -16,9 +17,8 @@ trait TimestampsTrait
private \DateTimeImmutable $timeCreated;

/**
* @ORM\Column(name="time_modified", type="datetimetz_immutable", nullable=true)
*/
#[ORM\Column(name: "time_modified", type: "datetimetz_immutable", nullable: true)]
#[ORM\Column(name: "time_modified", type: Types::DATETIMETZ_IMMUTABLE, nullable: true)]
private ?\DateTimeImmutable $timeModified = null;

/**
Expand Down

0 comments on commit d445f5b

Please sign in to comment.