From 3e5aa8583b9e4ec04abd73df02c6cd67ea1d232b Mon Sep 17 00:00:00 2001 From: Chirag Chhatrala Date: Wed, 12 Feb 2025 10:03:05 +0530 Subject: [PATCH 1/4] Refactor form property logic rule to load condition mapping from external JSON file --- api/app/Rules/FormPropertyLogicRule.php | 673 +----------------------- 1 file changed, 12 insertions(+), 661 deletions(-) diff --git a/api/app/Rules/FormPropertyLogicRule.php b/api/app/Rules/FormPropertyLogicRule.php index a940993ec..e84fbbec6 100644 --- a/api/app/Rules/FormPropertyLogicRule.php +++ b/api/app/Rules/FormPropertyLogicRule.php @@ -18,662 +18,6 @@ class FormPropertyLogicRule implements DataAwareRule, ValidationRule 'disable-block', ]; - public const CONDITION_MAPPING = [ - 'text' => [ - 'comparators' => [ - 'equals' => [ - 'expected_type' => 'string', - ], - 'does_not_equal' => [ - 'expected_type' => 'string', - ], - 'contains' => [ - 'expected_type' => 'string', - ], - 'does_not_contain' => [ - 'expected_type' => 'string', - ], - 'starts_with' => [ - 'expected_type' => 'string', - ], - 'ends_with' => [ - 'expected_type' => 'string', - ], - 'is_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - 'is_not_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - 'content_length_equals' => [ - 'expected_type' => 'number', - ], - 'content_length_does_not_equal' => [ - 'expected_type' => 'number', - ], - 'content_length_greater_than' => [ - 'expected_type' => 'number', - ], - 'content_length_greater_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - 'content_length_less_than' => [ - 'expected_type' => 'number', - ], - 'content_length_less_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - 'matches_regex' => [ - 'expected_type' => 'string', - 'format' => [ - 'type' => 'regex' - ] - ], - 'does_not_match_regex' => [ - 'expected_type' => 'string', - 'format' => [ - 'type' => 'regex' - ] - ], - ], - ], - 'matrix' => [ - 'comparators' => [ - 'equals' => [ - 'expected_type' => 'object', - 'format' => [ - 'type' => 'object', - ], - ], - 'does_not_equal' => [ - 'expected_type' => 'object', - 'format' => [ - 'type' => 'object', - ], - ], - 'contains' => [ - 'expected_type' => 'object', - 'format' => [ - 'type' => 'object', - ], - ], - 'does_not_contain' => [ - 'expected_type' => 'object', - 'format' => [ - 'type' => 'object', - ], - ], - ], - ], - 'url' => [ - 'comparators' => [ - 'equals' => [ - 'expected_type' => 'string', - ], - 'does_not_equal' => [ - 'expected_type' => 'string', - ], - 'contains' => [ - 'expected_type' => 'string', - ], - 'does_not_contain' => [ - 'expected_type' => 'string', - ], - 'starts_with' => [ - 'expected_type' => 'string', - ], - 'ends_with' => [ - 'expected_type' => 'string', - ], - 'is_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - 'is_not_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - 'content_length_equals' => [ - 'expected_type' => 'number', - ], - 'content_length_does_not_equal' => [ - 'expected_type' => 'number', - ], - 'content_length_greater_than' => [ - 'expected_type' => 'number', - ], - 'content_length_greater_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - 'content_length_less_than' => [ - 'expected_type' => 'number', - ], - 'content_length_less_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - ], - ], - 'email' => [ - 'comparators' => [ - 'equals' => [ - 'expected_type' => 'string', - ], - 'does_not_equal' => [ - 'expected_type' => 'string', - ], - 'contains' => [ - 'expected_type' => 'string', - ], - 'does_not_contain' => [ - 'expected_type' => 'string', - ], - 'starts_with' => [ - 'expected_type' => 'string', - ], - 'ends_with' => [ - 'expected_type' => 'string', - ], - 'is_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - 'is_not_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - 'content_length_equals' => [ - 'expected_type' => 'number', - ], - 'content_length_does_not_equal' => [ - 'expected_type' => 'number', - ], - 'content_length_greater_than' => [ - 'expected_type' => 'number', - ], - 'content_length_greater_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - 'content_length_less_than' => [ - 'expected_type' => 'number', - ], - 'content_length_less_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - ], - ], - 'phone_number' => [ - 'comparators' => [ - 'equals' => [ - 'expected_type' => 'string', - ], - 'does_not_equal' => [ - 'expected_type' => 'string', - ], - 'contains' => [ - 'expected_type' => 'string', - ], - 'does_not_contain' => [ - 'expected_type' => 'string', - ], - 'starts_with' => [ - 'expected_type' => 'string', - ], - 'ends_with' => [ - 'expected_type' => 'string', - ], - 'is_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - 'is_not_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - 'content_length_equals' => [ - 'expected_type' => 'number', - ], - 'content_length_does_not_equal' => [ - 'expected_type' => 'number', - ], - 'content_length_greater_than' => [ - 'expected_type' => 'number', - ], - 'content_length_greater_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - 'content_length_less_than' => [ - 'expected_type' => 'number', - ], - 'content_length_less_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - ], - ], - 'number' => [ - 'comparators' => [ - 'equals' => [ - 'expected_type' => 'number', - ], - 'does_not_equal' => [ - 'expected_type' => 'number', - ], - 'greater_than' => [ - 'expected_type' => 'number', - ], - 'less_than' => [ - 'expected_type' => 'number', - ], - 'greater_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - 'less_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - 'is_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - 'is_not_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - 'content_length_equals' => [ - 'expected_type' => 'number', - ], - 'content_length_does_not_equal' => [ - 'expected_type' => 'number', - ], - 'content_length_greater_than' => [ - 'expected_type' => 'number', - ], - 'content_length_greater_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - 'content_length_less_than' => [ - 'expected_type' => 'number', - ], - 'content_length_less_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - ], - ], - 'rating' => [ - 'comparators' => [ - 'equals' => [ - 'expected_type' => 'number', - ], - 'does_not_equal' => [ - 'expected_type' => 'number', - ], - 'greater_than' => [ - 'expected_type' => 'number', - ], - 'less_than' => [ - 'expected_type' => 'number', - ], - 'greater_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - 'less_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - 'is_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - 'is_not_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - 'content_length_equals' => [ - 'expected_type' => 'number', - ], - 'content_length_does_not_equal' => [ - 'expected_type' => 'number', - ], - 'content_length_greater_than' => [ - 'expected_type' => 'number', - ], - 'content_length_greater_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - 'content_length_less_than' => [ - 'expected_type' => 'number', - ], - 'content_length_less_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - ], - ], - 'scale' => [ - 'comparators' => [ - 'equals' => [ - 'expected_type' => 'number', - ], - 'does_not_equal' => [ - 'expected_type' => 'number', - ], - 'greater_than' => [ - 'expected_type' => 'number', - ], - 'less_than' => [ - 'expected_type' => 'number', - ], - 'greater_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - 'less_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - 'is_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - 'is_not_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - 'content_length_equals' => [ - 'expected_type' => 'number', - ], - 'content_length_does_not_equal' => [ - 'expected_type' => 'number', - ], - 'content_length_greater_than' => [ - 'expected_type' => 'number', - ], - 'content_length_greater_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - 'content_length_less_than' => [ - 'expected_type' => 'number', - ], - 'content_length_less_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - ], - ], - 'slider' => [ - 'comparators' => [ - 'equals' => [ - 'expected_type' => 'number', - ], - 'does_not_equal' => [ - 'expected_type' => 'number', - ], - 'greater_than' => [ - 'expected_type' => 'number', - ], - 'less_than' => [ - 'expected_type' => 'number', - ], - 'greater_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - 'less_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - 'is_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - 'is_not_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - 'content_length_equals' => [ - 'expected_type' => 'number', - ], - 'content_length_does_not_equal' => [ - 'expected_type' => 'number', - ], - 'content_length_greater_than' => [ - 'expected_type' => 'number', - ], - 'content_length_greater_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - 'content_length_less_than' => [ - 'expected_type' => 'number', - ], - 'content_length_less_than_or_equal_to' => [ - 'expected_type' => 'number', - ], - ], - ], - 'checkbox' => [ - 'comparators' => [ - 'equals' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - 'does_not_equal' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - - ], - ], - 'select' => [ - 'comparators' => [ - 'equals' => [ - 'expected_type' => 'string', - ], - 'does_not_equal' => [ - 'expected_type' => 'string', - ], - 'is_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - 'is_not_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - ], - ], - 'multi_select' => [ - 'comparators' => [ - 'contains' => [ - 'expected_type' => ['object', 'string'], - 'format' => [ - 'type' => 'uuid', - ], - ], - 'does_not_contain' => [ - 'expected_type' => ['object', 'string'], - 'format' => [ - 'type' => 'uuid', - ], - ], - 'is_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - 'is_not_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - ], - ], - 'date' => [ - 'comparators' => [ - 'equals' => [ - 'expected_type' => 'string', - 'format' => [ - 'type' => 'date', - ], - ], - 'before' => [ - 'expected_type' => 'string', - 'format' => [ - 'type' => 'date', - ], - ], - 'after' => [ - 'expected_type' => 'string', - 'format' => [ - 'type' => 'date', - ], - ], - 'on_or_before' => [ - 'expected_type' => 'string', - 'format' => [ - 'type' => 'date', - ], - ], - 'on_or_after' => [ - 'expected_type' => 'string', - 'format' => [ - 'type' => 'date', - ], - ], - 'is_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - 'is_not_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - 'past_week' => [ - 'expected_type' => 'object', - 'format' => [ - 'type' => 'empty', - 'values' => '{}', - ], - ], - 'past_month' => [ - 'expected_type' => 'object', - 'format' => [ - 'type' => 'empty', - 'values' => '{}', - ], - ], - 'past_year' => [ - 'expected_type' => 'object', - 'format' => [ - 'type' => 'empty', - 'values' => '{}', - ], - ], - 'next_week' => [ - 'expected_type' => 'object', - 'format' => [ - 'type' => 'empty', - 'values' => '{}', - ], - ], - 'next_month' => [ - 'expected_type' => 'object', - 'format' => [ - 'type' => 'empty', - 'values' => '{}', - ], - ], - 'next_year' => [ - 'expected_type' => 'object', - 'format' => [ - 'type' => 'empty', - 'values' => '{}', - ], - ], - ], - ], - 'files' => [ - 'comparators' => [ - 'is_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - 'is_not_empty' => [ - 'expected_type' => 'boolean', - 'format' => [ - 'type' => 'enum', - 'values' => [true], - ], - ], - ], - ], - ]; - private $isConditionCorrect = true; private $isActionCorrect = true; @@ -686,6 +30,13 @@ class FormPropertyLogicRule implements DataAwareRule, ValidationRule private $operator = ''; + private $conditionMapping = []; + + public function __construct() + { + $this->conditionMapping = json_decode(file_get_contents(resource_path('data/open_filters.json')), true); + } + private function checkBaseCondition($condition) { @@ -729,21 +80,21 @@ private function checkBaseCondition($condition) $this->operator = $operator; $value = $condition['value']['value']; - if (!isset(self::CONDITION_MAPPING[$typeField])) { + if (!isset($this->conditionMapping[$typeField])) { $this->isConditionCorrect = false; $this->conditionErrors[] = 'configuration not found for condition type'; return; } - if (!isset(self::CONDITION_MAPPING[$typeField]['comparators'][$operator])) { + if (!isset($this->conditionMapping[$typeField]['comparators'][$operator])) { $this->isConditionCorrect = false; $this->conditionErrors[] = 'configuration not found for condition operator'; return; } - $type = self::CONDITION_MAPPING[$typeField]['comparators'][$operator]['expected_type']; + $type = $this->conditionMapping[$typeField]['comparators'][$operator]['expected_type'] ?? null; if (is_array($type)) { $foundCorrectType = false; @@ -765,8 +116,8 @@ private function checkBaseCondition($condition) private function valueHasCorrectType($type, $value) { - if ($type === 'string' && isset(self::CONDITION_MAPPING[$this->field['type']]['comparators'][$this->operator]['format'])) { - $format = self::CONDITION_MAPPING[$this->field['type']]['comparators'][$this->operator]['format']; + if ($type === 'string' && isset($this->conditionMapping[$this->field['type']]['comparators'][$this->operator]['format'])) { + $format = $this->conditionMapping[$this->field['type']]['comparators'][$this->operator]['format']; if ($format['type'] === 'regex') { try { preg_match('/' . $value . '/', ''); From f930d083bad70fb9f6a9450dbbfbb5258f9e5c2c Mon Sep 17 00:00:00 2001 From: Chirag Chhatrala Date: Wed, 12 Feb 2025 10:27:53 +0530 Subject: [PATCH 2/4] fix CONDITION_MAPPING --- api/app/Rules/FormPropertyLogicRule.php | 28 +++++++++++++------------ api/app/Rules/IntegrationLogicRule.php | 6 +++--- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/api/app/Rules/FormPropertyLogicRule.php b/api/app/Rules/FormPropertyLogicRule.php index e84fbbec6..289c061ba 100644 --- a/api/app/Rules/FormPropertyLogicRule.php +++ b/api/app/Rules/FormPropertyLogicRule.php @@ -18,6 +18,16 @@ class FormPropertyLogicRule implements DataAwareRule, ValidationRule 'disable-block', ]; + private static $conditionMappingData = null; + + public static function getConditionMapping() + { + if (self::$conditionMappingData === null) { + self::$conditionMappingData = json_decode(file_get_contents(resource_path('data/open_filters.json')), true); + } + return self::$conditionMappingData; + } + private $isConditionCorrect = true; private $isActionCorrect = true; @@ -30,16 +40,8 @@ class FormPropertyLogicRule implements DataAwareRule, ValidationRule private $operator = ''; - private $conditionMapping = []; - - public function __construct() - { - $this->conditionMapping = json_decode(file_get_contents(resource_path('data/open_filters.json')), true); - } - private function checkBaseCondition($condition) { - if (!isset($condition['value'])) { $this->isConditionCorrect = false; $this->conditionErrors[] = 'missing condition body'; @@ -80,21 +82,21 @@ private function checkBaseCondition($condition) $this->operator = $operator; $value = $condition['value']['value']; - if (!isset($this->conditionMapping[$typeField])) { + if (!isset(self::getConditionMapping()[$typeField])) { $this->isConditionCorrect = false; $this->conditionErrors[] = 'configuration not found for condition type'; return; } - if (!isset($this->conditionMapping[$typeField]['comparators'][$operator])) { + if (!isset(self::getConditionMapping()[$typeField]['comparators'][$operator])) { $this->isConditionCorrect = false; $this->conditionErrors[] = 'configuration not found for condition operator'; return; } - $type = $this->conditionMapping[$typeField]['comparators'][$operator]['expected_type'] ?? null; + $type = self::getConditionMapping()[$typeField]['comparators'][$operator]['expected_type'] ?? null; if (is_array($type)) { $foundCorrectType = false; @@ -116,8 +118,8 @@ private function checkBaseCondition($condition) private function valueHasCorrectType($type, $value) { - if ($type === 'string' && isset($this->conditionMapping[$this->field['type']]['comparators'][$this->operator]['format'])) { - $format = $this->conditionMapping[$this->field['type']]['comparators'][$this->operator]['format']; + if ($type === 'string' && isset(self::getConditionMapping()[$this->field['type']]['comparators'][$this->operator]['format'])) { + $format = self::getConditionMapping()[$this->field['type']]['comparators'][$this->operator]['format']; if ($format['type'] === 'regex') { try { preg_match('/' . $value . '/', ''); diff --git a/api/app/Rules/IntegrationLogicRule.php b/api/app/Rules/IntegrationLogicRule.php index 45fecc0cf..6fc67705a 100644 --- a/api/app/Rules/IntegrationLogicRule.php +++ b/api/app/Rules/IntegrationLogicRule.php @@ -58,21 +58,21 @@ private function checkBaseCondition($condition) $operator = $condition['value']['operator']; $value = $condition['value']['value']; - if (!isset(FormPropertyLogicRule::CONDITION_MAPPING[$typeField])) { + if (!isset(FormPropertyLogicRule::getConditionMapping()[$typeField])) { $this->isConditionCorrect = false; $this->conditionErrors[] = 'configuration not found for condition type'; return; } - if (!isset(FormPropertyLogicRule::CONDITION_MAPPING[$typeField]['comparators'][$operator])) { + if (!isset(FormPropertyLogicRule::getConditionMapping()[$typeField]['comparators'][$operator])) { $this->isConditionCorrect = false; $this->conditionErrors[] = 'configuration not found for condition operator'; return; } - $type = FormPropertyLogicRule::CONDITION_MAPPING[$typeField]['comparators'][$operator]['expected_type']; + $type = FormPropertyLogicRule::getConditionMapping()[$typeField]['comparators'][$operator]['expected_type']; if (is_array($type)) { $foundCorrectType = false; From 0780d62f9f7196c2600e10cfebc63ce69f60ee9b Mon Sep 17 00:00:00 2001 From: Chirag Chhatrala Date: Wed, 12 Feb 2025 12:06:46 +0530 Subject: [PATCH 3/4] use config file for load mapping --- api/app/Rules/FormPropertyLogicRule.php | 2 +- api/config/opnform.php | 1 + api/vapor.yml | 2 ++ docker/php-fpm-entrypoint | 8 +++++++- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/api/app/Rules/FormPropertyLogicRule.php b/api/app/Rules/FormPropertyLogicRule.php index 289c061ba..265408d90 100644 --- a/api/app/Rules/FormPropertyLogicRule.php +++ b/api/app/Rules/FormPropertyLogicRule.php @@ -23,7 +23,7 @@ class FormPropertyLogicRule implements DataAwareRule, ValidationRule public static function getConditionMapping() { if (self::$conditionMappingData === null) { - self::$conditionMappingData = json_decode(file_get_contents(resource_path('data/open_filters.json')), true); + self::$conditionMappingData = config('opnform.condition_mapping'); } return self::$conditionMappingData; } diff --git a/api/config/opnform.php b/api/config/opnform.php index 78dc5fcbb..cf01e3f9a 100644 --- a/api/config/opnform.php +++ b/api/config/opnform.php @@ -6,4 +6,5 @@ 'template_editor_emails' => explode(',', env('TEMPLATE_EDITOR_EMAILS') ?? ''), 'extra_pro_users_emails' => explode(',', env('EXTRA_PRO_USERS_EMAILS') ?? ''), 'show_official_templates' => env('SHOW_OFFICIAL_TEMPLATES', true), + 'condition_mapping' => json_decode(file_get_contents(resource_path('data/open_filters.json')), true), ]; diff --git a/api/vapor.yml b/api/vapor.yml index 10c2a4423..7622127ad 100644 --- a/api/vapor.yml +++ b/api/vapor.yml @@ -25,6 +25,7 @@ environments: - "php artisan disposable:update" deploy: - "php artisan migrate --force" + - "php artisan optimize" firewall: rate-limit: 1000 timeout: 60 @@ -42,6 +43,7 @@ environments: - "php artisan disposable:update" deploy: - "php artisan migrate --force" + - "php artisan optimize" firewall: rate-limit: 1000 timeout: 60 diff --git a/docker/php-fpm-entrypoint b/docker/php-fpm-entrypoint index bee567767..60d6377d9 100644 --- a/docker/php-fpm-entrypoint +++ b/docker/php-fpm-entrypoint @@ -10,7 +10,8 @@ main() { prep_storage wait_for_db apply_db_migrations - run_init_project + run_init_project + optimize_application run_server "$@" fi } @@ -57,6 +58,11 @@ run_init_project() { ./artisan app:init-project } +optimize_application() { + echo "Optimizing application" + ./artisan optimize +} + run_server() { echo "Starting server $@" exec "$@" From a634cf6aae83463fa3f840d69198fab0b513850c Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Fri, 14 Feb 2025 22:22:24 +0000 Subject: [PATCH 4/4] Simplify condition mapping retrieval in FormPropertyLogicRule --- api/app/Rules/FormPropertyLogicRule.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/api/app/Rules/FormPropertyLogicRule.php b/api/app/Rules/FormPropertyLogicRule.php index 265408d90..eb7c280f3 100644 --- a/api/app/Rules/FormPropertyLogicRule.php +++ b/api/app/Rules/FormPropertyLogicRule.php @@ -22,10 +22,7 @@ class FormPropertyLogicRule implements DataAwareRule, ValidationRule public static function getConditionMapping() { - if (self::$conditionMappingData === null) { - self::$conditionMappingData = config('opnform.condition_mapping'); - } - return self::$conditionMappingData; + return config('opnform.condition_mapping'); } private $isConditionCorrect = true;