File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
src/CoreShop/Component/Rule/Model Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 2020use CoreShop \Component \Resource \Model \ResourceInterface ;
2121use CoreShop \Component \Resource \Model \SetValuesTrait ;
2222use Doctrine \Common \Collections \Collection ;
23+ use CoreShop \Component \Rule \Model \ActionInterface ;
24+ use CoreShop \Component \Rule \Model \ConditionInterface ;
2325
2426/**
2527 * @psalm-suppress MissingConstructor
@@ -90,7 +92,9 @@ public function setConfiguration(array $configuration)
9092 private function normalizeConfiguration (array $ configuration ): array
9193 {
9294 foreach ($ configuration as $ key => $ value ) {
93- if ($ value instanceof Collection) {
95+ if ($ value instanceof ConditionInterface || $ value instanceof ActionInterface) {
96+ continue ;
97+ } elseif ($ value instanceof Collection) {
9498 $ configuration [$ key ] = $ this ->normalizeConfiguration ($ value ->toArray ());
9599 } elseif ($ value instanceof ResourceInterface) {
96100 $ configuration [$ key ] = $ value ->getId ();
Original file line number Diff line number Diff line change 2020use CoreShop \Component \Resource \Model \ResourceInterface ;
2121use CoreShop \Component \Resource \Model \SetValuesTrait ;
2222use Doctrine \Common \Collections \Collection ;
23+ use CoreShop \Component \Rule \Model \ActionInterface ;
24+ use CoreShop \Component \Rule \Model \ConditionInterface ;
2325
2426/**
2527 * @psalm-suppress MissingConstructor
@@ -90,7 +92,9 @@ public function setConfiguration(array $configuration)
9092 private function normalizeConfiguration (array $ configuration ): array
9193 {
9294 foreach ($ configuration as $ key => $ value ) {
93- if ($ value instanceof Collection) {
95+ if ($ value instanceof ConditionInterface || $ value instanceof ActionInterface) {
96+ continue ;
97+ } elseif ($ value instanceof Collection) {
9498 $ configuration [$ key ] = $ this ->normalizeConfiguration ($ value ->toArray ());
9599 } elseif ($ value instanceof ResourceInterface) {
96100 $ configuration [$ key ] = $ value ->getId ();
You can’t perform that action at this time.
0 commit comments