From 10a2c276c706f5dcbce949f23455e4e7908a5ea9 Mon Sep 17 00:00:00 2001 From: Daniel Subiabre Date: Mon, 28 Apr 2025 16:29:19 +0200 Subject: [PATCH] Drop 'classes' from rule names referencing --- .../Matchfunding/MatchStrategyApiResource.php | 4 ++-- src/Entity/Matchfunding/MatchStrategy.php | 10 +++++----- src/Matchfunding/Rule/RuleLocator.php | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ApiResource/Matchfunding/MatchStrategyApiResource.php b/src/ApiResource/Matchfunding/MatchStrategyApiResource.php index 09b6200..9798814 100644 --- a/src/ApiResource/Matchfunding/MatchStrategyApiResource.php +++ b/src/ApiResource/Matchfunding/MatchStrategyApiResource.php @@ -41,8 +41,8 @@ class MatchStrategyApiResource * * @var RuleApiResource[] */ - #[MapTo(MatchStrategy::class, property: 'ruleClasses', transformer: [self::class, 'rulesToNames'])] - #[MapFrom(MatchStrategy::class, property: 'ruleClasses', transformer: MatchRulesMapTransformer::class)] + #[MapTo(MatchStrategy::class, property: 'ruleNames', transformer: [self::class, 'rulesToNames'])] + #[MapFrom(MatchStrategy::class, property: 'ruleNames', transformer: MatchRulesMapTransformer::class)] public array $rules; /** diff --git a/src/Entity/Matchfunding/MatchStrategy.php b/src/Entity/Matchfunding/MatchStrategy.php index 3efb5c6..0316f7d 100644 --- a/src/Entity/Matchfunding/MatchStrategy.php +++ b/src/Entity/Matchfunding/MatchStrategy.php @@ -19,7 +19,7 @@ class MatchStrategy private ?MatchCall $call = null; #[ORM\Column(type: Types::ARRAY)] - private array $ruleClasses = []; + private array $ruleNames = []; #[ORM\Column(length: 255, nullable: true)] private ?string $formulaName = null; @@ -53,14 +53,14 @@ class MatchStrategy return $this; } - public function getRuleClasses(): array + public function getRuleNames(): array { - return $this->ruleClasses; + return $this->ruleNames; } - public function setRuleClasses(array $ruleClasses): static + public function setRuleNames(array $ruleNames): static { - $this->ruleClasses = $ruleClasses; + $this->ruleNames = $ruleNames; return $this; } diff --git a/src/Matchfunding/Rule/RuleLocator.php b/src/Matchfunding/Rule/RuleLocator.php index 2babd54..2c7b84c 100644 --- a/src/Matchfunding/Rule/RuleLocator.php +++ b/src/Matchfunding/Rule/RuleLocator.php @@ -34,7 +34,7 @@ class RuleLocator */ public function getFrom(MatchStrategy $strategy): array { - $rules = $strategy->getRuleClasses(); + $rules = $strategy->getRuleNames(); return \array_filter( $this->rulesByName,