From c1e88c3e83de06ab2384b496df27c85dd24d7a33 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 24 Feb 2024 18:21:53 +0100 Subject: [PATCH] Use named args to avoid passing default values for args --- ...link.Core.RedirectRule.Entity.ShortUrlRedirectRule.php | 2 +- ...Shlinkio.Shlink.Core.ShortUrl.Entity.DeviceLongUrl.php | 2 +- .../Shlinkio.Shlink.Core.ShortUrl.Entity.ShortUrl.php | 8 ++++---- .../Shlinkio.Shlink.Core.Visit.Entity.Visit.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.RedirectRule.Entity.ShortUrlRedirectRule.php b/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.RedirectRule.Entity.ShortUrlRedirectRule.php index 4ffd60d7..9ff70973 100644 --- a/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.RedirectRule.Entity.ShortUrlRedirectRule.php +++ b/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.RedirectRule.Entity.ShortUrlRedirectRule.php @@ -30,7 +30,7 @@ return static function (ClassMetadata $metadata, array $emConfig): void { ->build(); $builder->createManyToOne('shortUrl', ShortUrl\Entity\ShortUrl::class) - ->addJoinColumn('short_url_id', 'id', false, false, 'CASCADE') + ->addJoinColumn('short_url_id', 'id', nullable: false, onDelete: 'CASCADE') ->build(); $builder->createManyToMany('conditions', RedirectRule\Entity\RedirectCondition::class) diff --git a/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.ShortUrl.Entity.DeviceLongUrl.php b/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.ShortUrl.Entity.DeviceLongUrl.php index bcd3702e..1e84a292 100644 --- a/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.ShortUrl.Entity.DeviceLongUrl.php +++ b/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.ShortUrl.Entity.DeviceLongUrl.php @@ -36,6 +36,6 @@ return static function (ClassMetadata $metadata, array $emConfig): void { ->build(); $builder->createManyToOne('shortUrl', ShortUrl\Entity\ShortUrl::class) - ->addJoinColumn('short_url_id', 'id', false, false, 'CASCADE') + ->addJoinColumn('short_url_id', 'id', nullable: false, onDelete: 'CASCADE') ->build(); }; diff --git a/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.ShortUrl.Entity.ShortUrl.php b/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.ShortUrl.Entity.ShortUrl.php index 4967482e..ff933b8c 100644 --- a/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.ShortUrl.Entity.ShortUrl.php +++ b/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.ShortUrl.Entity.ShortUrl.php @@ -76,18 +76,18 @@ return static function (ClassMetadata $metadata, array $emConfig): void { $builder->createManyToMany('tags', Tag\Entity\Tag::class) ->setJoinTable(determineTableName('short_urls_in_tags', $emConfig)) - ->addInverseJoinColumn('tag_id', 'id', true, false, 'CASCADE') - ->addJoinColumn('short_url_id', 'id', true, false, 'CASCADE') + ->addInverseJoinColumn('tag_id', 'id', onDelete: 'CASCADE') + ->addJoinColumn('short_url_id', 'id', onDelete: 'CASCADE') ->setOrderBy(['name' => 'ASC']) ->build(); $builder->createManyToOne('domain', Domain\Entity\Domain::class) - ->addJoinColumn('domain_id', 'id', true, false, 'RESTRICT') + ->addJoinColumn('domain_id', 'id', onDelete: 'RESTRICT') ->cascadePersist() ->build(); $builder->createManyToOne('authorApiKey', ApiKey::class) - ->addJoinColumn('author_api_key_id', 'id', true, false, 'SET NULL') + ->addJoinColumn('author_api_key_id', 'id', onDelete: 'SET NULL') ->build(); $builder->addUniqueConstraint(['short_code', 'domain_id'], 'unique_short_code_plus_domain'); diff --git a/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Visit.Entity.Visit.php b/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Visit.Entity.Visit.php index 28adea80..7d402384 100644 --- a/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Visit.Entity.Visit.php +++ b/module/Core/config/entities-mappings/Shlinkio.Shlink.Core.Visit.Entity.Visit.php @@ -49,11 +49,11 @@ return static function (ClassMetadata $metadata, array $emConfig): void { ->build(); $builder->createManyToOne('shortUrl', ShortUrl\Entity\ShortUrl::class) - ->addJoinColumn('short_url_id', 'id', true, false, 'CASCADE') + ->addJoinColumn('short_url_id', 'id', onDelete: 'CASCADE') ->build(); $builder->createManyToOne('visitLocation', Visit\Entity\VisitLocation::class) - ->addJoinColumn('visit_location_id', 'id', true, false, 'Set NULL') + ->addJoinColumn('visit_location_id', 'id', onDelete: 'Set NULL') ->cascadePersist() ->build();