From ddfbba344a6aebaf7420e48058cadc8273d94a4b Mon Sep 17 00:00:00 2001 From: mitsuha_s Date: Sat, 22 Jul 2023 17:29:24 +0300 Subject: [PATCH] DBAL types added to all Paste class properties --- src/Entity/Paste.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Entity/Paste.php b/src/Entity/Paste.php index 2e3d3e6..f797c5f 100644 --- a/src/Entity/Paste.php +++ b/src/Entity/Paste.php @@ -4,7 +4,6 @@ declare(strict_types = 1); namespace App\Entity; use App\DTO\PasteFormData; use App\Repository\PasteRepository; -use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; #[ORM\Entity(repositoryClass: PasteRepository::class)] @@ -18,21 +17,21 @@ class Paste private function __construct( #[ORM\Column(type: 'text', nullable: false)] public readonly string $text, - #[ORM\Column(length: 25, nullable: true)] + #[ORM\Column(type: 'string', length: 25, nullable: true)] public readonly ?string $language, #[ORM\Column(type: 'text', nullable: true)] public readonly ?string $description, - #[ORM\Column(length: 128, nullable: true)] + #[ORM\Column(type: 'string', length: 128, nullable: true)] public readonly ?string $filename, - #[ORM\Column(length: 128, nullable: false)] + #[ORM\Column(type: 'string', length: 128, nullable: false)] public readonly string $author, - #[ORM\Column(type: Types::DATETIME_IMMUTABLE, nullable: false)] + #[ORM\Column(type: 'datetime_immutable', nullable: false)] public readonly \DateTimeImmutable $publishDate, - #[ORM\Column(type: Types::DATETIME_IMMUTABLE, nullable: true)] + #[ORM\Column(type: 'datetime_immutable', nullable: true)] public readonly ?\DateTimeImmutable $expirationDate, - #[ORM\Column(length: 15, nullable: false)] + #[ORM\Column(type: 'string', length: 15, nullable: false)] public readonly string $ip, - #[ORM\Column(length: 40, nullable: true)] + #[ORM\Column(type: 'string', length: 40, nullable: true)] public readonly ?string $secret, ) {}