diff --git a/src/FieldTypes/Configs/FieldTypeBaseConfig.php b/src/FieldTypes/Configs/FieldTypeBaseConfig.php index 4f0697e..4f0648c 100644 --- a/src/FieldTypes/Configs/FieldTypeBaseConfig.php +++ b/src/FieldTypes/Configs/FieldTypeBaseConfig.php @@ -14,7 +14,7 @@ abstract class FieldTypeBaseConfig implements Contracts\FieldTypeConfig { use Macroable; - + abstract public function applyConfig(Forms\Components\Component $component): void; abstract public function getFormSchema(): array; diff --git a/tests/FieldGroupTest.php b/tests/FieldGroupTest.php index 68bc8f2..d66a0cd 100644 --- a/tests/FieldGroupTest.php +++ b/tests/FieldGroupTest.php @@ -4,7 +4,6 @@ use SolutionForest\FilamentFieldGroup\Tests\Support\TestModels\Field; use SolutionForest\FilamentFieldGroup\Tests\Support\TestModels\FieldGroup; -use SolutionForest\FilamentFieldGroup\Supports\FieldGroupConfig; use SolutionForest\FilamentFieldGroup\Tests\TestCase; class FieldGroupTest extends TestCase @@ -57,4 +56,4 @@ public function it_deletes_related_fields_when_deleted() 'id' => $field->id, ]); } -} \ No newline at end of file +} diff --git a/tests/FieldTest/BaseTestCase.php b/tests/FieldTest/BaseTestCase.php index fbca439..d974790 100644 --- a/tests/FieldTest/BaseTestCase.php +++ b/tests/FieldTest/BaseTestCase.php @@ -26,11 +26,11 @@ public function it_can_macroable() $this->assertEquals('test', $fieldType->testMacro()); } - + /** * Builds a form component and performs assertions using the provided field type callback. * - * @param callable(TField) $fieldTypeCallback A callback function that defines the field type to be used in the form component. + * @param callable(TField) $fieldTypeCallback A callback function that defines the field type to be used in the form component. * @return TFieldComponent The form component. */ protected function initializeFormComponentAndVerify($fieldTypeCallback) @@ -51,6 +51,6 @@ protected function initializeFormComponentAndVerify($fieldTypeCallback) */ private function buildFieldType() { - return new static::$fieldTypeClass(); + return new static::$fieldTypeClass; } } diff --git a/tests/FieldTest/ColorPickerTest.php b/tests/FieldTest/ColorPickerTest.php index 124cdc7..f9a9e56 100644 --- a/tests/FieldTest/ColorPickerTest.php +++ b/tests/FieldTest/ColorPickerTest.php @@ -24,4 +24,4 @@ public function it_can_apply_config() $this->assertEquals($defaultValue, $field->getDefaultState()); } -} \ No newline at end of file +} diff --git a/tests/FieldTest/DateTimePickerTest.php b/tests/FieldTest/DateTimePickerTest.php index 9cb2c4a..58f47d6 100644 --- a/tests/FieldTest/DateTimePickerTest.php +++ b/tests/FieldTest/DateTimePickerTest.php @@ -24,4 +24,4 @@ public function it_can_apply_config() $this->assertEquals($defaultValue, $field->getDefaultState()); } -} \ No newline at end of file +} diff --git a/tests/FieldTest/EmailTest.php b/tests/FieldTest/EmailTest.php index 00f6338..2167f0e 100644 --- a/tests/FieldTest/EmailTest.php +++ b/tests/FieldTest/EmailTest.php @@ -15,13 +15,13 @@ class EmailTest extends BaseTestCase public function it_can_apply_config() { $placeholder = 'Enter email here'; - + $field = $this->initializeFormComponentAndVerify(function (Email $email) use ($placeholder) { $email->placeholder = $placeholder; - + return $email; }); $this->assertEquals($placeholder, $field->getPlaceholder()); } -} \ No newline at end of file +} diff --git a/tests/FieldTest/FileTest.php b/tests/FieldTest/FileTest.php index c93c476..5c76c10 100644 --- a/tests/FieldTest/FileTest.php +++ b/tests/FieldTest/FileTest.php @@ -30,4 +30,4 @@ public function it_can_apply_config() $this->assertEquals($maxFileSize, $field->getMaxSize()); $this->assertEquals($maxFiles, $field->getMaxFiles()); } -} \ No newline at end of file +} diff --git a/tests/FieldTest/ImageTest.php b/tests/FieldTest/ImageTest.php index edc023f..c036fb6 100644 --- a/tests/FieldTest/ImageTest.php +++ b/tests/FieldTest/ImageTest.php @@ -14,8 +14,8 @@ class ImageTest extends BaseTestCase /** @test */ public function it_can_apply_config() { - $field = $this->initializeFormComponentAndVerify(fn (Image $image) => $image); + $field = $this->initializeFormComponentAndVerify(fn (Image $image) => $image); $this->assertEquals(['image/*'], $field->getAcceptedFileTypes()); } -} \ No newline at end of file +} diff --git a/tests/FieldTest/NumberTest.php b/tests/FieldTest/NumberTest.php index 13c2fc7..aa68fdb 100644 --- a/tests/FieldTest/NumberTest.php +++ b/tests/FieldTest/NumberTest.php @@ -17,12 +17,12 @@ public function it_can_apply_config() $placeholder = 'Enter number here'; $min = 1; $max = 10; - + $field = $this->initializeFormComponentAndVerify(function (Number $number) use ($placeholder, $min, $max) { $number->placeholder = $placeholder; $number->minValue = $min; $number->maxValue = $max; - + return $number; }); @@ -30,4 +30,4 @@ public function it_can_apply_config() $this->assertEquals($min, $field->getMinValue()); $this->assertEquals($max, $field->getMaxValue()); } -} \ No newline at end of file +} diff --git a/tests/FieldTest/PasswordTest.php b/tests/FieldTest/PasswordTest.php index 032c8db..7084237 100644 --- a/tests/FieldTest/PasswordTest.php +++ b/tests/FieldTest/PasswordTest.php @@ -14,8 +14,8 @@ class PasswordTest extends BaseTestCase /** @test */ public function it_can_apply_config() { - $field = $this->initializeFormComponentAndVerify(fn (Password $password) => $password); + $field = $this->initializeFormComponentAndVerify(fn (Password $password) => $password); $this->assertEquals(true, $field->isPassword()); } -} \ No newline at end of file +} diff --git a/tests/FieldTest/RadioTest.php b/tests/FieldTest/RadioTest.php index 768e17e..00180b5 100644 --- a/tests/FieldTest/RadioTest.php +++ b/tests/FieldTest/RadioTest.php @@ -25,4 +25,3 @@ public function it_can_apply_config() $this->assertEquals($options, $field->getOptions()); } } - diff --git a/tests/FieldTest/SelectTest.php b/tests/FieldTest/SelectTest.php index 4343205..c159e24 100644 --- a/tests/FieldTest/SelectTest.php +++ b/tests/FieldTest/SelectTest.php @@ -25,4 +25,3 @@ public function it_can_apply_config() $this->assertEquals($options, $field->getOptions()); } } - diff --git a/tests/FieldTest/TextAreaTest.php b/tests/FieldTest/TextAreaTest.php index a6e78b3..7288b05 100644 --- a/tests/FieldTest/TextAreaTest.php +++ b/tests/FieldTest/TextAreaTest.php @@ -30,4 +30,4 @@ public function it_can_apply_config() $this->assertEquals($placeholder, $field->getPlaceholder()); $this->assertEquals($defaultValue, $field->getDefaultState()); } -} \ No newline at end of file +} diff --git a/tests/FieldTest/TextTest.php b/tests/FieldTest/TextTest.php index c945f82..10c1d70 100644 --- a/tests/FieldTest/TextTest.php +++ b/tests/FieldTest/TextTest.php @@ -20,7 +20,7 @@ public function it_can_apply_config() $suffixLabel = 'Suffix'; $placeholder = 'Enter text'; $defaultValue = 'Default Value'; - + $field = $this->initializeFormComponentAndVerify(function (Text $text) use ($maxLength, $minLength, $prefixLabel, $suffixLabel, $placeholder, $defaultValue) { $text->maxLength = $maxLength; $text->minLength = $minLength; @@ -46,4 +46,3 @@ public function it_can_apply_config() $this->assertEquals($defaultValue, $field->getDefaultState()); } } - diff --git a/tests/FieldTest/ToggleTest.php b/tests/FieldTest/ToggleTest.php index 31a7877..66e11bc 100644 --- a/tests/FieldTest/ToggleTest.php +++ b/tests/FieldTest/ToggleTest.php @@ -19,4 +19,3 @@ public function it_can_apply_config() }); } } - diff --git a/tests/FieldTest/UrlTest.php b/tests/FieldTest/UrlTest.php index e439333..68508f5 100644 --- a/tests/FieldTest/UrlTest.php +++ b/tests/FieldTest/UrlTest.php @@ -27,4 +27,4 @@ public function it_can_apply_config() $this->assertEquals($placeholder, $field->getPlaceholder()); $this->assertEquals($defaultValue, $field->getDefaultState()); } -} \ No newline at end of file +} diff --git a/tests/TestCase.php b/tests/TestCase.php index e218747..5044fb7 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -64,7 +64,7 @@ public function getEnvironmentSetUp($app) /** * Builds a form component for the specified field type. * - * @param \SolutionForest\FilamentFieldGroup\FieldTypes\Configs\Contracts\FieldTypeConfig $fieldType The type of the field for which the form component is to be built. + * @param \SolutionForest\FilamentFieldGroup\FieldTypes\Configs\Contracts\FieldTypeConfig $fieldType The type of the field for which the form component is to be built. * @return array{0: \Filament\Forms\Components\Component, 1: \Filament\Forms\Components\Component} */ protected function buildFormComponentForFieldType($fieldType) @@ -77,7 +77,7 @@ protected function buildFormComponentForFieldType($fieldType) Field::factory([ 'type' => $fieldTypeConfig['name'], 'config' => $config, - ]), + ]), 'fields' ) ->create();