Skip to content

Commit ea6e55c

Browse files
Baspagithub-actions[bot]
authored andcommitted
Fix styling
1 parent f27d7b6 commit ea6e55c

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/Fields/FormSchemas/VisibilityRulesSchema.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public static function make(): array
4343
$excludeUlid = $record->ulid;
4444
}
4545
}
46+
4647
return FieldOptionsHelper::getFieldOptions($livewire, $excludeUlid);
4748
})
4849
->required(),
@@ -68,7 +69,7 @@ public static function make(): array
6869
->required(),
6970
Forms\Components\TextInput::make('value')
7071
->label(__('Value'))
71-
->visible(fn (Forms\Get $get): bool => !in_array($get('operator'), ['is_empty', 'is_not_empty'])),
72+
->visible(fn (Forms\Get $get): bool => ! in_array($get('operator'), ['is_empty', 'is_not_empty'])),
7273
])
7374
->collapsible()
7475
->itemLabel(fn (array $state): ?string => $state['field'] ?? null)
@@ -85,4 +86,4 @@ public static function make(): array
8586
]),
8687
];
8788
}
88-
}
89+
}

src/Fields/Logic/VisibilityLogicApplier.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ protected static function evaluateRuleConditions(Forms\Get $get, array $conditio
6868
return true;
6969
}
7070

71-
return $logic === 'AND'
72-
? !in_array(false, $results, true) // All must be true
71+
return $logic === 'AND'
72+
? ! in_array(false, $results, true) // All must be true
7373
: in_array(true, $results, true); // At least one must be true
7474
}
7575

@@ -113,21 +113,23 @@ protected static function evaluateCondition($fieldValue, string $operator, $expe
113113
return is_numeric($fieldValue) && is_numeric($expectedValue) && $fieldValue <= $expectedValue;
114114

115115
case 'in':
116-
if (!is_string($expectedValue)) {
116+
if (! is_string($expectedValue)) {
117117
return false;
118118
}
119119
$allowedValues = array_map('trim', explode(',', $expectedValue));
120+
120121
return in_array($fieldValue, $allowedValues);
121122

122123
case 'not_in':
123-
if (!is_string($expectedValue)) {
124+
if (! is_string($expectedValue)) {
124125
return true;
125126
}
126127
$excludedValues = array_map('trim', explode(',', $expectedValue));
127-
return !in_array($fieldValue, $excludedValues);
128+
129+
return ! in_array($fieldValue, $excludedValues);
128130

129131
default:
130132
return false;
131133
}
132134
}
133-
}
135+
}

0 commit comments

Comments
 (0)