From bf0584f4f5dfbfb379b9b39fbb519e207e499033 Mon Sep 17 00:00:00 2001 From: Daniel Subiabre Date: Sat, 6 Sep 2025 15:01:03 +0200 Subject: [PATCH] Reduce deprecation notices --- config/packages/zenstruck_foundry.yaml | 2 ++ src/Entity/Project/Support.php | 5 ++--- src/EventSubscriber/AuthorizationTokenSubscriber.php | 2 +- src/Money/Currency/ExchangeLocator.php | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/config/packages/zenstruck_foundry.yaml b/config/packages/zenstruck_foundry.yaml index e3ed04b..71fd8fe 100644 --- a/config/packages/zenstruck_foundry.yaml +++ b/config/packages/zenstruck_foundry.yaml @@ -1,5 +1,7 @@ when@dev: &dev # See full configuration: https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#full-default-bundle-configuration zenstruck_foundry: + persistence: + flush_once: true when@test: *dev diff --git a/src/Entity/Project/Support.php b/src/Entity/Project/Support.php index d37c05c..6a7f414 100644 --- a/src/Entity/Project/Support.php +++ b/src/Entity/Project/Support.php @@ -12,10 +12,9 @@ use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; #[MapProvider(EntityMapProvider::class)] +#[ORM\Table(name: 'project_support')] +#[ORM\UniqueConstraint(fields: ['project', 'origin'])] #[ORM\Entity(repositoryClass: SupportRepository::class)] -#[ORM\Table(name: 'project_support', uniqueConstraints: [ - new ORM\UniqueConstraint(fields: ['project', 'origin']), -])] class Support { #[ORM\Id] diff --git a/src/EventSubscriber/AuthorizationTokenSubscriber.php b/src/EventSubscriber/AuthorizationTokenSubscriber.php index 1c9541f..e9a11a4 100644 --- a/src/EventSubscriber/AuthorizationTokenSubscriber.php +++ b/src/EventSubscriber/AuthorizationTokenSubscriber.php @@ -17,7 +17,7 @@ final class AuthorizationTokenSubscriber implements EventSubscriberInterface private AuthService $authService, ) {} - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return [ KernelEvents::VIEW => ['onView', EventPriorities::POST_WRITE], diff --git a/src/Money/Currency/ExchangeLocator.php b/src/Money/Currency/ExchangeLocator.php index f4970c8..1a3ee12 100644 --- a/src/Money/Currency/ExchangeLocator.php +++ b/src/Money/Currency/ExchangeLocator.php @@ -24,7 +24,7 @@ class ExchangeLocator * @param ExchangeInterface $b */ usort($exchanges, function ($a, $b) { - return $a->getWeight() < $b->getWeight(); + return $a->getWeight() <=> $b->getWeight(); }); foreach ($exchanges as $exchange) {