Skip to content

Commit 1542d4b

Browse files
committed
fix: resolve rector issues for CI compatibility with rector 2.3.9
Apply SimplifyIfReturnBoolRector, StrictInArrayRector, ExplicitBoolCompareRector, and RemoveNullArgOnNullDefaultParamRector
1 parent beace13 commit 1542d4b

5 files changed

Lines changed: 7 additions & 11 deletions

File tree

src/Filament/Management/Forms/Components/VisibilityComponent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ private function resetConditionValues(?Get $get, Set $set): void
462462
$this->clearAllValueFields($set);
463463
$set('field_code', null);
464464

465-
if ($get) {
465+
if ($get instanceof Get) {
466466
$set('operator', array_key_first($this->getCompatibleOperators($get)));
467467
}
468468
}

src/Filament/Management/Schemas/FieldForm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ public static function schema(bool $withOptionsRelationship = true): array
404404
'select',
405405
'multi_select',
406406
'tags-input',
407-
])
407+
], true)
408408
),
409409
// Multi-value settings
410410
Toggle::make('settings.allow_multiple')

src/Services/ModelAttributeDiscoveryService.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,7 @@ private function shouldIncludeColumn(array $column, array $castExcluded): bool
185185

186186
$excludedTypes = ['json', 'binary', 'blob', 'longblob', 'mediumblob'];
187187

188-
if (in_array(strtolower($column['type_name']), $excludedTypes, true)) {
189-
return false;
190-
}
191-
192-
return true;
188+
return ! in_array(strtolower($column['type_name']), $excludedTypes, true);
193189
}
194190

195191
/**

src/Services/ValidationService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ private function combineRules(array $primaryRules, array $secondaryRules): array
154154

155155
$ruleName = explode(':', $rule, 2)[0];
156156

157-
return ! in_array($ruleName, $primaryRuleNames);
157+
return ! in_array($ruleName, $primaryRuleNames, true);
158158
});
159159

160160
// Combine the rules, with primary rules first

tests/Feature/Data/VisibilityDataTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@
303303
],
304304
]);
305305

306-
expect($visibility->evaluate([], null))->toBeTrue();
306+
expect($visibility->evaluate([]))->toBeTrue();
307307
});
308308

309309
it('still evaluates custom field conditions when record is null', function (): void {
@@ -326,8 +326,8 @@
326326
],
327327
]);
328328

329-
expect($visibility->evaluate(['priority' => 'high'], null))->toBeTrue()
330-
->and($visibility->evaluate(['priority' => 'low'], null))->toBeFalse();
329+
expect($visibility->evaluate(['priority' => 'high']))->toBeTrue()
330+
->and($visibility->evaluate(['priority' => 'low']))->toBeFalse();
331331
});
332332
});
333333

0 commit comments

Comments
 (0)