From e0c73d739b57955957f52b54b95a3908f381992c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harri=20H=C3=A4iv=C3=A4l=C3=A4?= Date: Mon, 28 Oct 2024 17:09:46 +0200 Subject: [PATCH] use TYPES in decleration --- symfony/rector.php | 7 +++++++ symfony/src/Entity/AccessGroups.php | 2 +- symfony/src/Entity/Accessory.php | 2 +- symfony/src/Entity/AccessoryChoice.php | 2 +- symfony/src/Entity/Artist.php | 8 ++++---- symfony/src/Entity/Booking.php | 8 ++++---- symfony/src/Entity/Contract.php | 2 +- symfony/src/Entity/DoorLog.php | 2 +- symfony/src/Entity/Email.php | 6 +++--- symfony/src/Entity/Event.php | 22 +++++++++++----------- symfony/src/Entity/EventArtistInfo.php | 6 +++--- symfony/src/Entity/File.php | 2 +- symfony/src/Entity/Item.php | 16 ++++++++-------- symfony/src/Entity/Member.php | 16 ++++++++-------- symfony/src/Entity/Menu.php | 6 +++--- symfony/src/Entity/Nakki.php | 2 +- symfony/src/Entity/NakkiDefinition.php | 4 ++-- symfony/src/Entity/Package.php | 4 ++-- symfony/src/Entity/RSVP.php | 6 +++--- symfony/src/Entity/Renter.php | 14 +++++++------- symfony/src/Entity/StatusEvent.php | 2 +- symfony/src/Entity/Ticket.php | 2 +- symfony/src/Entity/User.php | 4 ++-- symfony/src/Entity/WhoCanRentChoice.php | 2 +- symfony/src/EventListener/RSVPListener.php | 2 +- 25 files changed, 78 insertions(+), 71 deletions(-) diff --git a/symfony/rector.php b/symfony/rector.php index 512c325f..e7e8a2a0 100644 --- a/symfony/rector.php +++ b/symfony/rector.php @@ -4,6 +4,8 @@ use Rector\Config\RectorConfig; use Rector\Set\ValueObject\SetList; +use Rector\Transform\Rector\Attribute\AttributeKeyToClassConstFetchRector; +use Rector\Transform\ValueObject\AttributeKeyToClassConstFetch; return RectorConfig::configure() ->withPaths([ @@ -16,4 +18,9 @@ ->withTypeCoverageLevel(0) ->withSets([SetList::PHP_83]) ->withAttributesSets(symfony: true, doctrine: true) + ->withConfiguredRule(AttributeKeyToClassConstFetchRector::class, [ + new AttributeKeyToClassConstFetch('Doctrine\\ORM\\Mapping\\Column', 'type', 'Doctrine\\DBAL\\Types\\Types', [ + 'string' => 'STRING', + ]), + ]) ->withPreparedSets(deadCode: true); diff --git a/symfony/src/Entity/AccessGroups.php b/symfony/src/Entity/AccessGroups.php index 6b7b60b5..f02ce168 100644 --- a/symfony/src/Entity/AccessGroups.php +++ b/symfony/src/Entity/AccessGroups.php @@ -16,7 +16,7 @@ class AccessGroups implements \Stringable #[ORM\Column(type: 'integer')] private ?int $id = null; - #[ORM\Column(type: 'string', length: 255)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)] private ?string $name = null; #[ORM\ManyToMany(targetEntity: User::class, inversedBy: 'accessGroups')] diff --git a/symfony/src/Entity/Accessory.php b/symfony/src/Entity/Accessory.php index 1078b90d..724844f4 100755 --- a/symfony/src/Entity/Accessory.php +++ b/symfony/src/Entity/Accessory.php @@ -20,7 +20,7 @@ class Accessory implements \Stringable #[ORM\ManyToOne(targetEntity: \App\Entity\AccessoryChoice::class, cascade: ['persist'])] private ?\App\Entity\AccessoryChoice $name = null; - #[ORM\Column(name: 'count', type: 'string', length: 50)] + #[ORM\Column(name: 'count', type: \Doctrine\DBAL\Types\Types::STRING, length: 50)] #[Assert\NotBlank] private ?string $count = null; diff --git a/symfony/src/Entity/AccessoryChoice.php b/symfony/src/Entity/AccessoryChoice.php index abcaf7da..1b2ae28f 100644 --- a/symfony/src/Entity/AccessoryChoice.php +++ b/symfony/src/Entity/AccessoryChoice.php @@ -13,7 +13,7 @@ class AccessoryChoice implements \Stringable #[ORM\GeneratedValue(strategy: 'AUTO')] private ?int $id = null; - #[ORM\Column(name: 'name', type: 'string', length: 190)] + #[ORM\Column(name: 'name', type: \Doctrine\DBAL\Types\Types::STRING, length: 190)] private string $name; #[ORM\Column(name: 'compensationPrice', type: 'integer')] diff --git a/symfony/src/Entity/Artist.php b/symfony/src/Entity/Artist.php index 92a48722..94de5daa 100644 --- a/symfony/src/Entity/Artist.php +++ b/symfony/src/Entity/Artist.php @@ -20,13 +20,13 @@ class Artist implements \Stringable #[ORM\Column(type: 'integer')] private ?int $id = null; - #[ORM\Column(type: 'string', length: 190)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 190)] private ?string $name = null; - #[ORM\Column(type: 'string', length: 255, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)] private ?string $genre = null; - #[ORM\Column(type: 'string', length: 255, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)] private ?string $type = null; #[Assert\Expression( @@ -36,7 +36,7 @@ class Artist implements \Stringable #[ORM\Column(type: 'text', nullable: true)] private ?string $bio = null; - #[ORM\Column(type: 'string', length: 255, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)] private ?string $hardware = null; #[ORM\OneToMany(targetEntity: EventArtistInfo::class, mappedBy: 'Artist', cascade: ['persist', 'detach'])] diff --git a/symfony/src/Entity/Booking.php b/symfony/src/Entity/Booking.php index 20f1503b..bc6278ea 100644 --- a/symfony/src/Entity/Booking.php +++ b/symfony/src/Entity/Booking.php @@ -19,13 +19,13 @@ class Booking implements \Stringable #[ORM\GeneratedValue(strategy: 'AUTO')] private ?int $id = null; - #[ORM\Column(name: 'name', type: 'string', length: 190)] + #[ORM\Column(name: 'name', type: \Doctrine\DBAL\Types\Types::STRING, length: 190)] private ?string $name = null; - #[ORM\Column(name: 'referenceNumber', type: 'string', length: 190)] + #[ORM\Column(name: 'referenceNumber', type: \Doctrine\DBAL\Types\Types::STRING, length: 190)] private int|string $referenceNumber = 0; - #[ORM\Column(name: 'renterHash', type: 'string', length: 199)] + #[ORM\Column(name: 'renterHash', type: \Doctrine\DBAL\Types\Types::STRING, length: 199)] private int|string $renterHash = 0; #[ORM\Column(name: 'renterConsent', type: 'boolean')] @@ -107,7 +107,7 @@ class Booking implements \Stringable #[ORM\ManyToMany(targetEntity: Reward::class, mappedBy: 'bookings')] private $rewards; - #[ORM\Column(type: 'string', length: 255, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)] private ?string $reasonForDiscount = null; #[ORM\Column(type: 'text', nullable: true)] diff --git a/symfony/src/Entity/Contract.php b/symfony/src/Entity/Contract.php index 584a0ef3..4f4880b2 100644 --- a/symfony/src/Entity/Contract.php +++ b/symfony/src/Entity/Contract.php @@ -20,7 +20,7 @@ class Contract implements \Stringable #[ORM\Column(type: 'datetime')] private ?\DateTimeInterface $updatedAt = null; - #[ORM\Column(type: 'string', length: 255, unique: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, unique: true)] private ?string $purpose = null; #[ORM\Column(type: 'datetime')] diff --git a/symfony/src/Entity/DoorLog.php b/symfony/src/Entity/DoorLog.php index 43ddc866..3e740f5e 100644 --- a/symfony/src/Entity/DoorLog.php +++ b/symfony/src/Entity/DoorLog.php @@ -21,7 +21,7 @@ class DoorLog #[ORM\Column(type: 'datetime')] private \DateTimeInterface|\DateTime|null $createdAt = null; - #[ORM\Column(type: 'string', length: 255, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)] private ?string $message = null; public function getId(): ?int diff --git a/symfony/src/Entity/Email.php b/symfony/src/Entity/Email.php index 76ea9f0a..b72438b4 100644 --- a/symfony/src/Entity/Email.php +++ b/symfony/src/Entity/Email.php @@ -13,13 +13,13 @@ class Email implements \Stringable #[ORM\Column(type: 'integer')] private ?int $id = null; - #[ORM\Column(type: 'string', length: 255)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)] private ?string $subject = null; #[ORM\Column(type: 'text')] private ?string $body = null; - #[ORM\Column(type: 'string', length: 255, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)] private ?string $purpose = null; #[ORM\Column(type: 'datetime')] @@ -34,7 +34,7 @@ class Email implements \Stringable #[ORM\ManyToOne(targetEntity: Event::class, inversedBy: 'emails')] private ?\App\Entity\Event $event = null; - #[ORM\Column(type: 'string', length: 255, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)] private ?string $replyTo = null; #[ORM\Column(nullable: true)] diff --git a/symfony/src/Entity/Event.php b/symfony/src/Entity/Event.php index 53d9434a..3380cbd3 100644 --- a/symfony/src/Entity/Event.php +++ b/symfony/src/Entity/Event.php @@ -21,10 +21,10 @@ class Event implements \Stringable #[ORM\Column(type: 'integer')] private ?int $id = null; - #[ORM\Column(type: 'string', length: 255)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)] private ?string $Name = null; - #[ORM\Column(type: 'string', length: 255)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)] private ?string $Nimi = null; #[ORM\Column(type: 'datetime')] @@ -64,16 +64,16 @@ class Event implements \Stringable private ?string $Sisallys = "Käytä näitä, vaikka monta kertaa:
{{ timetable }}
{{ timetable_to_page }}
{{ bios }}
{{ vj_bios }}
{{ rsvp }}
{{ links }}
{{ happening_list }}"; - #[ORM\Column(type: 'string', length: 255, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)] private ?string $url = null; #[ORM\Column(type: 'boolean')] private bool $published = false; - #[ORM\Column(type: 'string', length: 180)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 180)] private ?string $type = null; - #[ORM\Column(type: 'string', length: 180, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 180, nullable: true)] private ?string $epics = null; #[ORM\Column(type: 'boolean')] @@ -82,7 +82,7 @@ class Event implements \Stringable #[ORM\Column(type: 'boolean')] private bool $sticky = false; - #[ORM\Column(type: 'string', length: 255)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)] private string $picturePosition = 'banner'; #[ORM\Column(type: 'boolean')] @@ -138,16 +138,16 @@ class Event implements \Stringable #[ORM\Column(type: 'boolean', nullable: true)] private ?bool $includeSaferSpaceGuidelines = false; - #[ORM\Column(type: 'string', length: 255)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)] private ?string $headerTheme = 'light'; - #[ORM\Column(type: 'string', length: 255, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)] private ?string $streamPlayerUrl = null; - #[ORM\Column(type: 'string', length: 255, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)] private ?string $imgFilterColor = null; - #[ORM\Column(type: 'string', length: 255, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)] private ?string $imgFilterBlendMode = null; #[ORM\Column(type: 'boolean', nullable: true)] @@ -159,7 +159,7 @@ class Event implements \Stringable #[ORM\Column(type: 'datetime_immutable', nullable: true)] private ?\DateTimeImmutable $artistSignUpStart = null; - #[ORM\Column(type: 'string', length: 255, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)] private ?string $webMeetingUrl = null; #[ORM\Column(type: 'boolean', nullable: true)] diff --git a/symfony/src/Entity/EventArtistInfo.php b/symfony/src/Entity/EventArtistInfo.php index 7fb47b1e..c4dad132 100644 --- a/symfony/src/Entity/EventArtistInfo.php +++ b/symfony/src/Entity/EventArtistInfo.php @@ -13,7 +13,7 @@ class EventArtistInfo implements \Stringable #[ORM\Column(type: 'integer')] private ?int $id = null; - #[ORM\Column(type: 'string', length: 255, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)] private ?string $SetLength = null; #[ORM\Column(type: 'datetime', nullable: true)] @@ -25,7 +25,7 @@ class EventArtistInfo implements \Stringable #[ORM\ManyToOne(targetEntity: Artist::class, inversedBy: 'eventArtistInfos', cascade: ['persist'])] private ?\App\Entity\Artist $Artist = null; - #[ORM\Column(type: 'string', length: 255, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)] private ?string $WishForPlayTime = null; #[ORM\ManyToOne(targetEntity: Artist::class, cascade: ['persist'])] @@ -34,7 +34,7 @@ class EventArtistInfo implements \Stringable #[ORM\Column(type: 'text', nullable: true)] private ?string $freeWord = null; - #[ORM\Column(type: 'string', length: 255, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)] private ?string $stage = null; public function getId(): ?int diff --git a/symfony/src/Entity/File.php b/symfony/src/Entity/File.php index baaaaa1d..405f1338 100755 --- a/symfony/src/Entity/File.php +++ b/symfony/src/Entity/File.php @@ -14,7 +14,7 @@ class File implements \Stringable #[ORM\GeneratedValue(strategy: 'AUTO')] private ?int $id = null; - #[ORM\Column(name: 'tiedostoinfo', type: 'string', length: 190, nullable: true)] + #[ORM\Column(name: 'tiedostoinfo', type: \Doctrine\DBAL\Types\Types::STRING, length: 190, nullable: true)] private ?string $fileinfo = null; #[ORM\ManyToOne(targetEntity: \App\Entity\Item::class, inversedBy: 'files')] diff --git a/symfony/src/Entity/Item.php b/symfony/src/Entity/Item.php index 4248f628..a1d1f8f0 100644 --- a/symfony/src/Entity/Item.php +++ b/symfony/src/Entity/Item.php @@ -25,25 +25,25 @@ class Item implements \Stringable #[ORM\GeneratedValue(strategy: 'AUTO')] private ?int $id = null; - #[ORM\Column(name: 'Name', type: 'string', length: 190)] + #[ORM\Column(name: 'Name', type: \Doctrine\DBAL\Types\Types::STRING, length: 190)] private string $name; - #[ORM\Column(name: 'Manufacturer', type: 'string', length: 190, nullable: true)] + #[ORM\Column(name: 'Manufacturer', type: \Doctrine\DBAL\Types\Types::STRING, length: 190, nullable: true)] private ?string $manufacturer = null; - #[ORM\Column(name: 'Model', type: 'string', length: 190, nullable: true)] + #[ORM\Column(name: 'Model', type: \Doctrine\DBAL\Types\Types::STRING, length: 190, nullable: true)] private ?string $model = null; - #[ORM\Column(name: 'Url', type: 'string', length: 500, nullable: true)] + #[ORM\Column(name: 'Url', type: \Doctrine\DBAL\Types\Types::STRING, length: 500, nullable: true)] private ?string $url = null; - #[ORM\Column(name: 'SerialNumber', type: 'string', length: 190, nullable: true)] + #[ORM\Column(name: 'SerialNumber', type: \Doctrine\DBAL\Types\Types::STRING, length: 190, nullable: true)] private ?string $serialnumber = null; - #[ORM\Column(name: 'PlaceInStorage', type: 'string', length: 190, nullable: true)] + #[ORM\Column(name: 'PlaceInStorage', type: \Doctrine\DBAL\Types\Types::STRING, length: 190, nullable: true)] private ?string $placeinstorage = null; - #[ORM\Column(name: 'Description', type: 'string', length: 4000, nullable: true)] + #[ORM\Column(name: 'Description', type: \Doctrine\DBAL\Types\Types::STRING, length: 4000, nullable: true)] private ?string $description = null; #[ORM\ManyToMany(targetEntity: WhoCanRentChoice::class, cascade: ['persist'])] @@ -65,7 +65,7 @@ class Item implements \Stringable #[ORM\Column(name: 'compensationPrice', type: 'decimal', precision: 7, scale: 2, nullable: true)] private $compensationPrice; - #[ORM\Column(name: 'RentNotice', type: 'string', length: 5000, nullable: true)] + #[ORM\Column(name: 'RentNotice', type: \Doctrine\DBAL\Types\Types::STRING, length: 5000, nullable: true)] private ?string $rentNotice = null; #[ORM\Column(name: 'NeedsFixing', type: 'boolean')] diff --git a/symfony/src/Entity/Member.php b/symfony/src/Entity/Member.php index 7fb18e77..e57482bd 100644 --- a/symfony/src/Entity/Member.php +++ b/symfony/src/Entity/Member.php @@ -22,22 +22,22 @@ class Member implements \Stringable #[ORM\GeneratedValue(strategy: 'AUTO')] private ?int $id = null; - #[ORM\Column(name: 'firstname', type: 'string', length: 190)] + #[ORM\Column(name: 'firstname', type: \Doctrine\DBAL\Types\Types::STRING, length: 190)] private string $firstname; - #[ORM\Column(name: 'lastname', type: 'string', length: 190)] + #[ORM\Column(name: 'lastname', type: \Doctrine\DBAL\Types\Types::STRING, length: 190)] private string $lastname; - #[ORM\Column(name: 'email', type: 'string', length: 190, unique: true)] + #[ORM\Column(name: 'email', type: \Doctrine\DBAL\Types\Types::STRING, length: 190, unique: true)] private $email; - #[ORM\Column(name: 'username', type: 'string', length: 190, nullable: true)] + #[ORM\Column(name: 'username', type: \Doctrine\DBAL\Types\Types::STRING, length: 190, nullable: true)] private ?string $username = null; - #[ORM\Column(name: 'phone', type: 'string', length: 190, nullable: true)] + #[ORM\Column(name: 'phone', type: \Doctrine\DBAL\Types\Types::STRING, length: 190, nullable: true)] private ?string $phone = null; - #[ORM\Column(name: 'CityOfResidence', type: 'string', length: 190, nullable: true)] + #[ORM\Column(name: 'CityOfResidence', type: \Doctrine\DBAL\Types\Types::STRING, length: 190, nullable: true)] private ?string $CityOfResidence = null; #[ORM\Column(name: 'createdAt', type: 'datetime')] @@ -77,7 +77,7 @@ class Member implements \Stringable #[ORM\Cache(usage: 'NONSTRICT_READ_WRITE', region: 'member')] private ?\App\Entity\User $user = null; - #[ORM\Column(type: 'string', length: 8)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 8)] private ?string $locale = 'fi'; #[ORM\OneToMany(targetEntity: Artist::class, mappedBy: 'member', orphanRemoval: true)] @@ -87,7 +87,7 @@ class Member implements \Stringable #[ORM\OneToMany(targetEntity: DoorLog::class, mappedBy: 'member', orphanRemoval: true)] private $doorLogs; - #[ORM\Column(type: 'string', length: 255, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)] private ?string $theme = null; #[ORM\OneToMany(targetEntity: RSVP::class, mappedBy: 'member', orphanRemoval: true)] diff --git a/symfony/src/Entity/Menu.php b/symfony/src/Entity/Menu.php index 10e822da..f48b605c 100644 --- a/symfony/src/Entity/Menu.php +++ b/symfony/src/Entity/Menu.php @@ -18,13 +18,13 @@ class Menu implements \Stringable #[ORM\Column(type: 'integer')] private $id; - #[ORM\Column(type: 'string', length: 180)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 180)] private ?string $label = null; - #[ORM\Column(type: 'string', length: 180)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 180)] private ?string $nimi = null; - #[ORM\Column(type: 'string', length: 180, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 180, nullable: true)] private ?string $url = null; #[ORM\ManyToOne(targetEntity: Page::class)] diff --git a/symfony/src/Entity/Nakki.php b/symfony/src/Entity/Nakki.php index 16de4bc8..cacc69e8 100644 --- a/symfony/src/Entity/Nakki.php +++ b/symfony/src/Entity/Nakki.php @@ -42,7 +42,7 @@ class Nakki implements \Stringable #[ORM\JoinColumn(onDelete: "SET NULL", nullable: true)] private ?\App\Entity\Member $responsible = null; - #[ORM\Column(type: 'string', length: 255, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)] private ?string $mattermostChannel = null; #[ORM\Column(nullable: true)] diff --git a/symfony/src/Entity/NakkiDefinition.php b/symfony/src/Entity/NakkiDefinition.php index e27d2e38..031b3934 100644 --- a/symfony/src/Entity/NakkiDefinition.php +++ b/symfony/src/Entity/NakkiDefinition.php @@ -13,10 +13,10 @@ class NakkiDefinition implements \Stringable #[ORM\Column(type: 'integer')] private ?int $id = null; - #[ORM\Column(type: 'string', length: 255)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)] private ?string $nameFi = null; - #[ORM\Column(type: 'string', length: 255)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)] private ?string $nameEn = null; #[ORM\Column(type: 'text')] diff --git a/symfony/src/Entity/Package.php b/symfony/src/Entity/Package.php index 28e1433d..5b3d375f 100755 --- a/symfony/src/Entity/Package.php +++ b/symfony/src/Entity/Package.php @@ -19,10 +19,10 @@ class Package implements \Stringable #[ORM\ManyToMany(targetEntity: Item::class, mappedBy: 'packages', orphanRemoval: false, fetch: 'EAGER')] private ?Collection $items; - #[ORM\Column(name: 'name', type: 'string', length: 190)] + #[ORM\Column(name: 'name', type: \Doctrine\DBAL\Types\Types::STRING, length: 190)] private string $name; - #[ORM\Column(name: 'rent', type: 'string', length: 190)] + #[ORM\Column(name: 'rent', type: \Doctrine\DBAL\Types\Types::STRING, length: 190)] private string $rent; #[ORM\Column(name: 'needs_fixing', type: 'boolean')] diff --git a/symfony/src/Entity/RSVP.php b/symfony/src/Entity/RSVP.php index 120232ea..84047415 100644 --- a/symfony/src/Entity/RSVP.php +++ b/symfony/src/Entity/RSVP.php @@ -25,13 +25,13 @@ class RSVP implements \Stringable #[ORM\Column(type: 'datetime_immutable')] private ?\DateTimeImmutable $createdAt = null; - #[ORM\Column(type: 'string', length: 255, nullable: true, unique: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true, unique: true)] private ?string $email = null; - #[ORM\Column(type: 'string', length: 255, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)] private ?string $firstName = null; - #[ORM\Column(type: 'string', length: 255, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)] private ?string $lastName = null; #[ORM\PrePersist] diff --git a/symfony/src/Entity/Renter.php b/symfony/src/Entity/Renter.php index a04fa1aa..3816c00e 100755 --- a/symfony/src/Entity/Renter.php +++ b/symfony/src/Entity/Renter.php @@ -22,25 +22,25 @@ class Renter implements \Stringable #[ORM\OneToMany(targetEntity: Booking::class, mappedBy: 'renter')] private $bookings; - #[ORM\Column(name: 'name', type: 'string', length: 190)] + #[ORM\Column(name: 'name', type: \Doctrine\DBAL\Types\Types::STRING, length: 190)] private string $name; - #[ORM\Column(name: 'streetadress', type: 'string', length: 190, nullable: true)] + #[ORM\Column(name: 'streetadress', type: \Doctrine\DBAL\Types\Types::STRING, length: 190, nullable: true)] private ?string $streetadress = null; - #[ORM\Column(name: 'organization', type: 'string', length: 190, nullable: true)] + #[ORM\Column(name: 'organization', type: \Doctrine\DBAL\Types\Types::STRING, length: 190, nullable: true)] private ?string $organization = null; - #[ORM\Column(name: 'zipcode', type: 'string', length: 190, nullable: true)] + #[ORM\Column(name: 'zipcode', type: \Doctrine\DBAL\Types\Types::STRING, length: 190, nullable: true)] private ?string $zipcode = null; - #[ORM\Column(name: 'city', type: 'string', length: 190, nullable: true)] + #[ORM\Column(name: 'city', type: \Doctrine\DBAL\Types\Types::STRING, length: 190, nullable: true)] private ?string $city = null; - #[ORM\Column(name: 'phone', type: 'string', length: 190, nullable: true)] + #[ORM\Column(name: 'phone', type: \Doctrine\DBAL\Types\Types::STRING, length: 190, nullable: true)] private ?string $phone = null; - #[ORM\Column(name: 'email', type: 'string', length: 190, nullable: true)] + #[ORM\Column(name: 'email', type: \Doctrine\DBAL\Types\Types::STRING, length: 190, nullable: true)] private ?string $email = null; /** diff --git a/symfony/src/Entity/StatusEvent.php b/symfony/src/Entity/StatusEvent.php index 7af084d7..b901f80c 100644 --- a/symfony/src/Entity/StatusEvent.php +++ b/symfony/src/Entity/StatusEvent.php @@ -26,7 +26,7 @@ class StatusEvent implements \Stringable #[ORM\ManyToOne(targetEntity: \App\Entity\Booking::class, inversedBy: 'statusEvents')] private ?\App\Entity\Booking $booking = null; - #[ORM\Column(name: 'Description', type: 'string', length: 5000, nullable: true)] + #[ORM\Column(name: 'Description', type: \Doctrine\DBAL\Types\Types::STRING, length: 5000, nullable: true)] private string $description; #[ORM\Column(name: 'CreatedAt', type: 'datetime')] diff --git a/symfony/src/Entity/Ticket.php b/symfony/src/Entity/Ticket.php index 0b3a1d3a..4ad3d44e 100644 --- a/symfony/src/Entity/Ticket.php +++ b/symfony/src/Entity/Ticket.php @@ -30,7 +30,7 @@ class Ticket implements \Stringable #[ORM\Column(type: 'integer', nullable: true)] private ?int $referenceNumber = null; - #[ORM\Column(type: 'string', length: 255)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)] #[Assert\Choice(choices: Ticket::STATUSES)] private string $status = 'available'; diff --git a/symfony/src/Entity/User.php b/symfony/src/Entity/User.php index 7439c382..5a40c2e3 100644 --- a/symfony/src/Entity/User.php +++ b/symfony/src/Entity/User.php @@ -26,7 +26,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter /** * @var string The hashed password */ - #[ORM\Column(type: 'string')] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING)] #[Assert\Length(min: 8)] private ?string $password = null; @@ -48,7 +48,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter #[ORM\Column(type: 'datetime', nullable: true)] private ?\DateTimeInterface $LastLogin = null; - #[ORM\Column(type: 'string', length: 255, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: true)] private ?string $MattermostId = null; #[ORM\ManyToMany(targetEntity: AccessGroups::class, mappedBy: 'users')] diff --git a/symfony/src/Entity/WhoCanRentChoice.php b/symfony/src/Entity/WhoCanRentChoice.php index 9591d4ab..e86b4234 100755 --- a/symfony/src/Entity/WhoCanRentChoice.php +++ b/symfony/src/Entity/WhoCanRentChoice.php @@ -16,7 +16,7 @@ class WhoCanRentChoice implements \Stringable #[ORM\GeneratedValue(strategy: 'AUTO')] private ?int $id = null; - #[ORM\Column(name: 'name', type: 'string', length: 190)] + #[ORM\Column(name: 'name', type: \Doctrine\DBAL\Types\Types::STRING, length: 190)] private string $name; /** diff --git a/symfony/src/EventListener/RSVPListener.php b/symfony/src/EventListener/RSVPListener.php index 79ec453b..7f3983a9 100644 --- a/symfony/src/EventListener/RSVPListener.php +++ b/symfony/src/EventListener/RSVPListener.php @@ -19,7 +19,7 @@ public function __construct( private EmailRepository $emailRepository ) { } - public function sendRSVPMailListener(RSVP $rsvp, PostPersistEventArgs $eventArgs): void + public function sendRSVPMailListener(RSVP $rsvp): void { // Send an email to the user who RSVP'd $event = $rsvp->getEvent();